PaymentMethodCreateOptions.fromJson constructor
PaymentMethodCreateOptions.fromJson(
- Object? json
Implementation
factory PaymentMethodCreateOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return PaymentMethodCreateOptions(
acssDebit: map['acss_debit'] == null
? null
: PaymentIntentAcssDebit.fromJson(map['acss_debit']),
affirm: map['affirm'] == null ? null : (map['affirm'] as Object),
afterpayClearpay: map['afterpay_clearpay'] == null
? null
: (map['afterpay_clearpay'] as Object),
alipay: map['alipay'] == null ? null : (map['alipay'] as Object),
auBecsDebit: map['au_becs_debit'] == null
? null
: PaymentIntentAuBecsDebit.fromJson(map['au_becs_debit']),
bacsDebit: map['bacs_debit'] == null
? null
: PaymentIntentBacsDebit.fromJson(map['bacs_debit']),
bancontact:
map['bancontact'] == null ? null : (map['bancontact'] as Object),
billingDetails: map['billing_details'] == null
? null
: PaymentIntentBillingDetails.fromJson(map['billing_details']),
blik: map['blik'] == null ? null : (map['blik'] as Object),
boleto: map['boleto'] == null
? null
: PaymentMethodDetailsBoleto.fromJson(map['boleto']),
card:
map['card'] == null ? null : PaymentMethodCard.fromJson(map['card']),
cashapp: map['cashapp'] == null ? null : (map['cashapp'] as Object),
customer: map['customer'] == null ? null : (map['customer'] as String),
customerBalance: map['customer_balance'] == null
? null
: (map['customer_balance'] as Object),
eps: map['eps'] == null ? null : PaymentIntentEps.fromJson(map['eps']),
expand: map['expand'] == null
? null
: (map['expand'] as List<Object?>)
.map((el) => (el as String))
.toList(),
fpx: map['fpx'] == null ? null : PaymentIntentFpx.fromJson(map['fpx']),
giropay: map['giropay'] == null ? null : (map['giropay'] as Object),
grabpay: map['grabpay'] == null ? null : (map['grabpay'] as Object),
ideal: map['ideal'] == null
? null
: PaymentIntentIdeal.fromJson(map['ideal']),
interacPresent: map['interac_present'] == null
? null
: (map['interac_present'] as Object),
klarna: map['klarna'] == null
? null
: PaymentIntentKlarna.fromJson(map['klarna']),
konbini: map['konbini'] == null ? null : (map['konbini'] as Object),
link: map['link'] == null ? null : (map['link'] as Object),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
mobilepay: map['mobilepay'] == null ? null : (map['mobilepay'] as Object),
oxxo: map['oxxo'] == null ? null : (map['oxxo'] as Object),
p24: map['p24'] == null ? null : PaymentIntentP24.fromJson(map['p24']),
paymentMethod: map['payment_method'] == null
? null
: (map['payment_method'] as String),
paynow: map['paynow'] == null ? null : (map['paynow'] as Object),
paypal: map['paypal'] == null ? null : (map['paypal'] as Object),
pix: map['pix'] == null ? null : (map['pix'] as Object),
promptpay: map['promptpay'] == null ? null : (map['promptpay'] as Object),
radarOptions: map['radar_options'] == null
? null
: RadarRadarOptions.fromJson(map['radar_options']),
revolutPay:
map['revolut_pay'] == null ? null : (map['revolut_pay'] as Object),
sepaDebit: map['sepa_debit'] == null
? null
: PaymentIntentSepaDebit.fromJson(map['sepa_debit']),
sofort: map['sofort'] == null
? null
: PaymentIntentSofort.fromJson(map['sofort']),
swish: map['swish'] == null ? null : (map['swish'] as Object),
type:
map['type'] == null ? null : PaymentMethodsType.fromJson(map['type']),
usBankAccount: map['us_bank_account'] == null
? null
: PaymentIntentUsBankAccount.fromJson(map['us_bank_account']),
wechatPay:
map['wechat_pay'] == null ? null : (map['wechat_pay'] as Object),
zip: map['zip'] == null ? null : (map['zip'] as Object),
);
}