PaymentMethodCard.fromJson constructor
PaymentMethodCard.fromJson(
- Object? json
Implementation
factory PaymentMethodCard.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return PaymentMethodCard(
brand: (map['brand'] as String),
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),
displayBrand: map['display_brand'] == null
? null
: (map['display_brand'] as String),
expMonth: (map['exp_month'] as num).toInt(),
expYear: (map['exp_year'] as num).toInt(),
fingerprint:
map['fingerprint'] == null ? null : (map['fingerprint'] as String),
funding: (map['funding'] as String),
iin: map['iin'] == null ? null : (map['iin'] as String),
issuer: map['issuer'] == null ? null : (map['issuer'] as String),
last4: (map['last4'] as String),
networks:
map['networks'] == null ? null : Networks.fromJson(map['networks']),
threeDSecureUsage: map['three_d_secure_usage'] == null
? null
: PaymentMethodCardThreeDSecureUsage.fromJson(
map['three_d_secure_usage']),
wallet: map['wallet'] == null
? null
: PaymentMethodCardWallet.fromJson(map['wallet']),
);
}