TokenCreateOptions.fromJson constructor

TokenCreateOptions.fromJson(
  1. Object? json
)

Implementation

factory TokenCreateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TokenCreateOptions(
    account:
        map['account'] == null ? null : TokenAccount.fromJson(map['account']),
    bankAccount: map['bank_account'] == null
        ? null
        : TokenBankAccount.fromJson(map['bank_account']),
    card: map['card'] == null ? null : TokenCard.fromJson(map['card']),
    customer: map['customer'] == null ? null : (map['customer'] as String),
    cvcUpdate: map['cvc_update'] == null
        ? null
        : TokenCvcUpdate.fromJson(map['cvc_update']),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    person:
        map['person'] == null ? null : TokenPerson.fromJson(map['person']),
    pii: map['pii'] == null ? null : TokenPii.fromJson(map['pii']),
  );
}