PaymentMethodDetailsCard.fromJson constructor
PaymentMethodDetailsCard.fromJson(
- Object? json
Implementation
factory PaymentMethodDetailsCard.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return PaymentMethodDetailsCard(
amountAuthorized: map['amount_authorized'] == null
? null
: (map['amount_authorized'] as num).toInt(),
brand: map['brand'] == null ? null : (map['brand'] as String),
captureBefore: map['capture_before'] == null
? null
: DateTime.fromMillisecondsSinceEpoch(
(map['capture_before'] as int).toInt()),
checks: map['checks'] == null
? null
: PaymentMethodCardChecks.fromJson(map['checks']),
country: map['country'] == null ? null : (map['country'] as String),
description:
map['description'] == null ? null : (map['description'] as String),
expMonth: (map['exp_month'] as num).toInt(),
expYear: (map['exp_year'] as num).toInt(),
extendedAuthorization: map['extended_authorization'] == null
? null
: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization
.fromJson(map['extended_authorization']),
fingerprint:
map['fingerprint'] == null ? null : (map['fingerprint'] as String),
funding: map['funding'] == null ? null : (map['funding'] as String),
iin: map['iin'] == null ? null : (map['iin'] as String),
incrementalAuthorization: map['incremental_authorization'] == null
? null
: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization
.fromJson(map['incremental_authorization']),
installments: map['installments'] == null
? null
: PaymentMethodDetailsCardInstallments.fromJson(map['installments']),
issuer: map['issuer'] == null ? null : (map['issuer'] as String),
last4: map['last4'] == null ? null : (map['last4'] as String),
mandate: map['mandate'] == null ? null : (map['mandate'] as String),
moto: map['moto'] == null ? null : (map['moto'] as bool),
multicapture: map['multicapture'] == null
? null
: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture
.fromJson(map['multicapture']),
network: map['network'] == null ? null : (map['network'] as String),
networkToken: map['network_token'] == null
? null
: PaymentMethodDetailsCardNetworkToken.fromJson(map['network_token']),
overcapture: map['overcapture'] == null
? null
: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture
.fromJson(map['overcapture']),
threeDSecure: map['three_d_secure'] == null
? null
: PaymentMethodDetailsCardThreeDSecure.fromJson(
map['three_d_secure']),
wallet: map['wallet'] == null
? null
: PaymentMethodDetailsCardWallet.fromJson(map['wallet']),
);
}