PaywayCreateTransaction.fromMap constructor

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

Implementation

factory PaywayCreateTransaction.fromMap(Map<String, dynamic> map) {
  return PaywayCreateTransaction(
    tranId: map['tran_id'] ?? '',
    reqTime: map['req_time'] ?? '',
    amount: map['amount']?.toDouble() ?? 0.0,
    items: List<PaywayTransactionItem>.from(
        map['items']?.map((x) => PaywayTransactionItem.fromMap(x))),
    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']?.toDouble(),
    option:
        $ABAPaymentOptionMap[map["payment_option"]] ?? ABAPaymentOption.cards,
    type: $ABATransactionTypeMap[map["type"]] ?? ABATransactionType.purchase,
    currency: $ABATransactionCurrencyMap[map["currency"]] ??
        ABATransactionCurrency.USD,
  );
}