AmwalInAppSdkSettings class
Configuration class for in-app payment scenarios.
This class extends IAmwalSdkSettings and is specifically designed for in-app payment flows where certain parameters like amount and currency are handled differently or set to default values.
Usage Example
final settings = AmwalInAppSdkSettings(
token: 'your_auth_token',
merchantId: 'merchant_123',
terminalIds: ['terminal_1'],
transactionId: 'txn_456',
merchantName: 'Your Store',
onPay: (result) => print('Payment completed: \$result'),
);
- Inheritance
-
- Object
- IAmwalSdkSettings
- AmwalInAppSdkSettings
Constructors
-
AmwalInAppSdkSettings.new({required String token, String? secureHashValue, required String merchantId, required List<
String> terminalIds, required String transactionId, required String? merchantName, required OnPayCallback onPay, GetTransactionFunction? getTransactionFunction, int countDownInSeconds = 90, double? maxTransactionAmount = 5000, OnPayCallback? onCountComplete, Locale locale = const Locale('en'), bool isMocked = false, void onError(Object e, StackTrace stack)?, Future<String?> onTokenExpired()?, void log(String, Map<String, dynamic> param)?, TransactionType transactionType = TransactionType.cardWallet, String? flavor, Map<String, String> ? additionValues, Environment? environment, void customerCallback(String?)?}) -
AmwalInAppSdkSettings.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
additionValues
→ Map<
String, String> ? -
Additional key-value pairs for extended configuration.
finalinherited
- amount → String
-
Transaction amount as a string.
finalinherited
- countDownInSeconds → int
-
Countdown duration in seconds for payment timeout.
finalinherited
- currency → String
-
Currency code (e.g., 'USD', 'SAR').
finalinherited
- customerCallback → void Function(String?)?
-
Callback for customer-specific actions.
finalinherited
- customerId → String?
-
Optional customer identifier.
finalinherited
- environment ↔ Environment?
-
Target environment (PROD, UAT, SIT).
getter/setter pairinherited
- flavor → String?
-
Optional flavor identifier for different app variants.
finalinherited
- getTransactionFunction → GetTransactionFunction?
-
Optional function to retrieve transaction details.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMocked → bool
-
Whether the SDK is running in mock/test mode.
finalinherited
- isSoftPOS → bool
-
Returns true if this is a SoftPOS transaction type.
no setterinherited
- locale → Locale
-
Locale for internationalization support (e.g., 'en', 'ar').
finalinherited
-
log
→ void Function(String, Map<
String, dynamic> param)? -
Logging callback for analytics and debugging.
finalinherited
- logger → AmwalLoggerFunction?
-
Optional custom logger function.
finalinherited
- maxTransactionAmount → double?
-
Maximum allowed transaction amount.
finalinherited
- merchantId → String
-
Unique identifier for the merchant.
finalinherited
- merchantName → String?
-
Optional merchant display name.
finalinherited
- onCountComplete → OnPayCallback?
-
Optional callback for countdown completion.
finalinherited
- onError → void Function(Object e, StackTrace stack)?
-
Error handling callback for exceptions.
finalinherited
- onPay → OnPayCallback
-
Callback function triggered when payment is completed.
finalinherited
- onResponse → void Function(String?)?
-
Callback for handling payment responses.
finalinherited
-
onTokenExpired
→ Future<
String?> Function()? -
Callback for handling token expiration.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secureHashValue ↔ String?
-
Secure hash value for additional security validation.
getter/setter pairinherited
- sessionToken → String
-
Session token for secure communication.
finalinherited
-
terminalIds
→ List<
String> -
List of terminal IDs associated with the merchant.
finalinherited
- token → String
-
Authentication token for API requests.
finalinherited
- transactionId → String
-
Unique identifier for the current transaction.
finalinherited
- transactionType → TransactionType
-
Type of transaction (card, wallet, NFC, etc.).
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this AmwalSdkSettings instance to a JSON map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited