PaymentMethodDetailsInteracPresent.fromJson constructor

PaymentMethodDetailsInteracPresent.fromJson(
  1. Object? json
)

Implementation

factory PaymentMethodDetailsInteracPresent.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentMethodDetailsInteracPresent(
    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),
    emvAuthData: map['emv_auth_data'] == null
        ? null
        : (map['emv_auth_data'] 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),
    generatedCard: map['generated_card'] == null
        ? null
        : (map['generated_card'] 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),
    network: map['network'] == null ? null : (map['network'] as String),
    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']),
    receipt: map['receipt'] == null
        ? null
        : PaymentMethodDetailsInteracPresentReceipt.fromJson(map['receipt']),
  );
}