PaymentArguments.fromMap constructor

PaymentArguments.fromMap(
  1. Map<String, dynamic> map
)

Creates a PaymentArguments instance from a Map.

This factory constructor is useful for deserializing payment arguments from JSON data, API responses, or stored configurations.

Parameters

  • map: A map containing the payment argument data

Returns

A new PaymentArguments instance populated with the map data

Example

final map = {
  'amount': '100.50',
  'terminalId': 'terminal_123',
  'merchantId': 456,
  'currencyData': {...},
  'transactionId': 'txn_789',
};
final paymentArgs = PaymentArguments.fromMap(map);

Implementation

factory PaymentArguments.fromMap(Map<String, dynamic> map) {
  return PaymentArguments(
    amount: map['amount'] as String,
    terminalId: map['terminalId'] as String,
    merchantId: map['merchantId'] as int,
    currencyData: CurrencyData.fromJson(map['currencyData']),
    transactionId: map['transactionId'],
  );
}