transaction static method
Reads a transaction sub-map.
Every field falls back to empty or false, which is what the native SDKs
do with the backend's JSON nulls.
Implementation
static EcrTransaction transaction(Map<Object?, Object?> map) {
return EcrTransaction(
transactionId: _string(map, EcrTransactionKeys.transactionId),
stan: _string(map, EcrTransactionKeys.stan),
type: _string(map, EcrTransactionKeys.type),
status: _string(map, EcrTransactionKeys.status),
amount: _string(map, EcrTransactionKeys.amount),
totalAmount: _string(map, EcrTransactionKeys.totalAmount),
currency: _string(map, EcrTransactionKeys.currency),
transactionTime: _string(map, EcrTransactionKeys.transactionTime),
maskedPan: _string(map, EcrTransactionKeys.maskedPan),
cardHolderName: _string(map, EcrTransactionKeys.cardHolderName),
rrn: _string(map, EcrTransactionKeys.rrn),
authCode: _string(map, EcrTransactionKeys.authCode),
batchId: _string(map, EcrTransactionKeys.batchId),
terminalId: _string(map, EcrTransactionKeys.terminalId),
isRefunded: _bool(map, EcrTransactionKeys.isRefunded),
canVoid: _bool(map, EcrTransactionKeys.canVoid),
canRefund: _bool(map, EcrTransactionKeys.canRefund),
partialApproval: _bool(map, EcrTransactionKeys.partialApproval),
authorizedAmount: _string(map, EcrTransactionKeys.authorizedAmount),
);
}