PaymentIntentNextActionDisplayBankTransferInstructions.fromJson constructor

PaymentIntentNextActionDisplayBankTransferInstructions.fromJson(
  1. Object? json
)

Implementation

factory PaymentIntentNextActionDisplayBankTransferInstructions.fromJson(
    Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentIntentNextActionDisplayBankTransferInstructions(
    amountRemaining: map['amount_remaining'] == null
        ? null
        : (map['amount_remaining'] as num).toInt(),
    currency: map['currency'] == null ? null : (map['currency'] as String),
    financialAddresses: map['financial_addresses'] == null
        ? null
        : (map['financial_addresses'] as List<Object?>)
            .map((el) =>
                FundingInstructionsBankTransferFinancialAddress.fromJson(el))
            .toList(),
    hostedInstructionsUrl: map['hosted_instructions_url'] == null
        ? null
        : (map['hosted_instructions_url'] as String),
    reference: map['reference'] == null ? null : (map['reference'] as String),
    type:
        CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType
            .fromJson(map['type']),
  );
}