initialize method
- 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,
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,
);
}