PaymentMethodCardPresent.fromJson constructor

PaymentMethodCardPresent.fromJson(
  1. Object? json
)

Implementation

factory PaymentMethodCardPresent.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentMethodCardPresent(
    brand: map['brand'] == null ? null : (map['brand'] as String),
    cardholderName: map['cardholder_name'] == null
        ? null
        : (map['cardholder_name'] as String),
    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(),
    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),
    issuer: map['issuer'] == null ? null : (map['issuer'] as String),
    last4: map['last4'] == null ? null : (map['last4'] as String),
    networks:
        map['networks'] == null ? null : Networks.fromJson(map['networks']),
    readMethod: map['read_method'] == null
        ? null
        : PaymentMethodCardPresentReadMethod.fromJson(map['read_method']),
  );
}