init method
Initialize the Amwal Wallet SDK with merchant configuration.
This method sets up the SDK with all necessary credentials and configuration parameters required for wallet payment processing.
Parameters
token
- Authentication token for API accessmerchantId
- Unique identifier for the merchantterminalIds
- List of terminal IDs for payment processingsecureHashValue
- Optional secure hash for additional validationtransactionRefNo
- Reference number for the transactionservice
- Network service instance for API communicationmerchantName
- Optional display name for the merchantisMocked
- Enable mock mode for testing (default: false)locale
- Locale for internationalization
Returns
Returns the initialized AmwalWalletSdk instance.
Example
final sdk = await AmwalWalletSdk.instance.init(
token: 'auth_token_123',
merchantId: 'merchant_456',
terminalIds: ['term_1', 'term_2'],
transactionRefNo: 'txn_789',
service: networkService,
merchantName: 'My Wallet Store',
locale: Locale('en', 'US'),
);
Implementation
Future<AmwalWalletSdk> init({
required String token,
required String merchantId,
required List<String> terminalIds,
String? secureHashValue,
required String transactionRefNo,
required NetworkService service,
String? merchantName,
bool isMocked = false,
Locale? locale,
}) async {
await WalletInjector.instance.onSdkInit(
() async => await _sdkInitialization(
token,
terminalIds,
secureHashValue,
merchantId,
isMocked,
service,
locale: locale,
merchantName: merchantName,
),
);
return this;
}