PurchaseData.fromMap constructor
PurchaseData.fromMap(
- Map<String, dynamic> map
)
Implementation
factory PurchaseData.fromMap(Map<String, dynamic> map) {
return PurchaseData(
message: map['message'] as String,
transactionId: map['transactionId'] as String,
hostResponseData: HostResponseData.fromMap(map['hostResponseData']),
isOtpRequired: map['isOtpRequired'],
terminalId: map['terminalId'],
transactionTypeId: map['transactionTypeId']?.toString(),
transactionTypeDisplayName: map['transactionTypeDisplayName']?.toString(),
currency: map['currency']?.toString(),
currencyId: map['currencyId']?.toString(),
merchantId: map['merchantId']?.toString(),
amount: map['amount']?.toString(),
transactionDate: formatLastLoggedInDate(
map['transactionDate'] ?? map['transactionTime'],
),
merchantName: map['merchantName'],
customerTokenId: map['customerTokenId'],
gatewayTransactionReference: map['gatewayTransactionReference'],
customerId: map['customerId'],
);
}