initialize method

  1. @override
Future<bool> initialize({
  1. required String merchantID,
  2. required List<FawryItem> items,
  3. String? merchantRefNumber,
  4. String? customerProfileId,
  5. Language language = Language.EN,
  6. Environment environment = Environment.TEST,
  7. DisplayMode webDisplayMode = DisplayMode.POPUP,
  8. int? paymentExpiry,
  9. String? returnUrl,
  10. bool? authCaptureModePayment,
  11. Map<String, dynamic>? customParam,
})
override

Initialize FawryPay payment charge.

Initialize the payment charge by adding some parameters. Returns true if it initialized fine. Throws exception if not.

merchantID sets the merchantID that you have received from Fawry. items sets the list of items that the user will pay for. merchantRefNumber sets an optional number consists of 16 random characters and numbers. customerProfileId sets an optional profile id (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). paymentExpiry sets the time in which it will expire this payment (Only Web). returnUrl sets return url which will go back after payment completed (Only Web & Must include if using Cards). authCaptureModePayment sets auth capture mode payment (Only Web). customParam sets a map of custom data you want to receive back with result data after payment.

Implementation

@override
Future<bool> initialize({
  required String merchantID,
  required List<FawryItem> items,
  String? merchantRefNumber,
  String? customerProfileId,
  Language language = Language.EN,
  Environment environment = Environment.TEST,
  DisplayMode webDisplayMode = DisplayMode.POPUP,
  int? paymentExpiry,
  String? returnUrl,
  bool? authCaptureModePayment,
  Map<String, dynamic>? customParam,
}) async {
  return await FlutterFawryPayPlatform.instance.initialize(
    merchantID: merchantID,
    items: items,
    merchantRefNumber: merchantRefNumber,
    customerProfileId: customerProfileId,
    language: language,
    environment: environment,
    webDisplayMode: webDisplayMode,
    paymentExpiry: paymentExpiry,
    returnUrl: returnUrl,
    authCaptureModePayment: authCaptureModePayment,
    customParam: customParam,
  );
}