AmwalSdkSettings class

Main configuration class for Amwal Pay SDK.

This is the primary settings class used for most payment scenarios. It extends IAmwalSdkSettings and provides a simplified interface by using a single terminalId instead of a list of terminal IDs.

Features

  • Simplified terminal configuration with single terminalId
  • JSON serialization support via fromJson and toJson
  • Full payment flow configuration
  • Support for all transaction types (card, wallet, NFC)

Usage Example

final settings = AmwalSdkSettings(
  merchantId: 'merchant_123',
  terminalId: 'terminal_1',
  transactionId: 'txn_456',
  currency: 'SAR',
  amount: '100.00',
);

await AmwalPaySdk.instance.initSdk(settings: settings);

JSON Support

This class supports JSON serialization for easy configuration management:

// From JSON
final settings = AmwalSdkSettings.fromJson(jsonMap);

// To JSON
final jsonMap = settings.toJson();
Inheritance

Constructors

AmwalSdkSettings.new({void onResponse(String?)?, String token = '', String? secureHashValue, required String merchantId, required String transactionId, required String currency, required String amount, required String terminalId, String? merchantName, GetTransactionFunction? getTransactionFunction, OnPayCallback? onCountComplete, Locale locale = const Locale('en'), bool isMocked = false, void onError(Object e, StackTrace stack)?, void log(String, Map<String, dynamic> param)?, Future<String?> onTokenExpired()?, int countDownInSeconds = 90, String? flavor, Map<String, String>? additionValues, String sessionToken = '', void customerCallback(String?)?, String? customerId, TransactionType transactionType = TransactionType.cardWallet, Environment? environment, double? maxTransactionAmount = 5000})
AmwalSdkSettings.fromJson(Map<String, dynamic> json)
Creates an AmwalSdkSettings instance from a JSON map.
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
terminalId String
The terminal ID for this payment session.
final
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>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited