ABATransaction.fromMap constructor
ABATransaction.fromMap(
- Map<String, dynamic> map
)
Implementation
factory ABATransaction.fromMap(Map<String, dynamic> map) {
return ABATransaction(
merchant: ABAMerchant.fromMap(map),
tranID: map["tran_id"],
reqTime: map["req_time"],
amount: double.tryParse("${map["amount"]}"),
items: List.from(map['items'] ?? [])
.map((e) => ABATransactionItem.fromMap(e))
.toList(),
firstname: map["firstname"],
lastname: map["lastname"],
phone: map["phone"],
email: map["email"],
returnUrl: map["return_url"],
continueSuccessUrl: map["continue_success_url"],
returnParams: map["return_params"],
shipping: map["shipping"] ?? 0.00,
option:
$ABAPaymentOptionMap[map["payment_option"]] ?? ABAPaymentOption.cards,
type: $ABATransactionTypeMap[map["type"]] ?? ABATransactionType.purchase,
currency: $ABATransactionCurrencyMap[map["currency"]] ??
ABATransactionCurrency.USD,
);
}