init method

  1. @override
Future<bool> init({
  1. required String merchantID,
  2. Style style = Style.STYLE1,
  3. bool enableLogging = false,
  4. bool enableMockups = false,
  5. bool skipCustomerInput = false,
  6. String? username,
  7. String? email,
  8. String? webCustomerName,
  9. Language language = Language.EN,
  10. Environment environment = Environment.TEST,
  11. DisplayMode webDisplayMode = DisplayMode.POPUP,
})
override

Init FawryPay SDK services.

This initialize the SDK for one time only and also can change at anytime. Set here some parameters to configure the SDK. Returns true if it initialized fine. Throws exception if not.

merchantID sets the merchantID that you have received from Fawry. style sets the style of SDK. enableLogging sets whether enable logs from SDK or not. skipCustomerInput sets whether you let user enter username and email, or there's a default username and email. If you set it to true, then you are required to set default username and email. username sets the default username if you set skipCustomerInput = true, it should be a phone number. email sets the default email if you set skipCustomerInput = true. webCustomerName optional sets customer name (Only Web). language sets the language of payment, whether English or Arabic, default English. environment sets the environment of payment, whether Test or Live, default Test. webDisplayMode sets display mode (Only Web).

Implementation

@override
Future<bool> init({
  required String merchantID,
  Style style = Style.STYLE1,
  bool enableLogging = false,
  bool enableMockups = false,
  bool skipCustomerInput = false,
  String? username,
  String? email,
  String? webCustomerName,
  Language language = Language.EN,
  Environment environment = Environment.TEST,
  DisplayMode webDisplayMode = DisplayMode.POPUP,
}) async {
  return await FlutterFawryPayPlatform.instance.init(
    merchantID: merchantID,
    style: style,
    enableLogging: enableLogging,
    enableMockups: enableMockups,
    skipCustomerInput: skipCustomerInput,
    username: username,
    email: email,
    webCustomerName: webCustomerName,
    language: language,
    environment: environment,
    webDisplayMode: webDisplayMode,
  );
}