PaymentMethodInteracPresent.fromJson constructor

PaymentMethodInteracPresent.fromJson(
  1. Object? json
)

Implementation

factory PaymentMethodInteracPresent.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentMethodInteracPresent(
    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
        : PaymentMethodCardPresentNetworks.fromJson(map['networks']),
    preferredLocales: map['preferred_locales'] == null
        ? null
        : (map['preferred_locales'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    readMethod: map['read_method'] == null
        ? null
        : PaymentMethodCardPresentReadMethod.fromJson(map['read_method']),
  );
}