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