IAmwalSdkSettings class abstract
Abstract base class for Amwal SDK settings configuration.
This class defines the common interface and properties required for configuring the Amwal Pay SDK. It contains all the essential parameters needed for payment processing, including merchant information, transaction details, and callback functions.
Key Properties
- Authentication: token, secureHashValue, sessionToken
- Merchant Info: merchantId, terminalIds, merchantName
- Transaction: transactionId, amount, currency, transactionType
- Localization: locale for multi-language support
- Callbacks: onPay, onError, onTokenExpired
Usage
This is an abstract class. Use concrete implementations like:
- AmwalSdkSettings for standard payment flows
- AmwalInAppSdkSettings for in-app payment scenarios
- Implementers
Constructors
-
IAmwalSdkSettings.new({void onResponse(String?)?, String? customerId, void customerCallback(String?)?, required String sessionToken, required String token, String? secureHashValue, required String merchantId, required List<
String> terminalIds, required String transactionId, required String currency, required String amount, required OnPayCallback onPay, int countDownInSeconds = 90, double? maxTransactionAmount = 5000, GetTransactionFunction? getTransactionFunction, void onError(Object e, StackTrace stack)?, OnPayCallback? onCountComplete, String? merchantName, AmwalLoggerFunction? logger, String? flavor, Map<String, String> ? additionValues, Locale locale = const Locale('en'), bool isMocked = false, TransactionType transactionType = TransactionType.cardWallet, Future<String?> onTokenExpired()?, void log(String, Map<String, dynamic> param)?, Environment? environment})
Properties
-
additionValues
→ Map<
String, String> ? -
Additional key-value pairs for extended configuration.
final
- amount → String
-
Transaction amount as a string.
final
- countDownInSeconds → int
-
Countdown duration in seconds for payment timeout.
final
- currency → String
-
Currency code (e.g., 'USD', 'SAR').
final
- customerCallback → void Function(String?)?
-
Callback for customer-specific actions.
final
- customerId → String?
-
Optional customer identifier.
final
- environment ↔ Environment?
-
Target environment (PROD, UAT, SIT).
getter/setter pair
- flavor → String?
-
Optional flavor identifier for different app variants.
final
- getTransactionFunction → GetTransactionFunction?
-
Optional function to retrieve transaction details.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMocked → bool
-
Whether the SDK is running in mock/test mode.
final
- isSoftPOS → bool
-
Returns true if this is a SoftPOS transaction type.
no setter
- locale → Locale
-
Locale for internationalization support (e.g., 'en', 'ar').
final
-
log
→ void Function(String, Map<
String, dynamic> param)? -
Logging callback for analytics and debugging.
final
- logger → AmwalLoggerFunction?
-
Optional custom logger function.
final
- maxTransactionAmount → double?
-
Maximum allowed transaction amount.
final
- merchantId → String
-
Unique identifier for the merchant.
final
- merchantName → String?
-
Optional merchant display name.
final
- onCountComplete → OnPayCallback?
-
Optional callback for countdown completion.
final
- onError → void Function(Object e, StackTrace stack)?
-
Error handling callback for exceptions.
final
- onPay → OnPayCallback
-
Callback function triggered when payment is completed.
final
- onResponse → void Function(String?)?
-
Callback for handling payment responses.
final
-
onTokenExpired
→ Future<
String?> Function()? -
Callback for handling token expiration.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secureHashValue ↔ String?
-
Secure hash value for additional security validation.
getter/setter pair
- sessionToken → String
-
Session token for secure communication.
final
-
terminalIds
→ List<
String> -
List of terminal IDs associated with the merchant.
final
- token → String
-
Authentication token for API requests.
final
- transactionId → String
-
Unique identifier for the current transaction.
final
- transactionType → TransactionType
-
Type of transaction (card, wallet, NFC, etc.).
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited