SetupIntentCreateOptions.fromJson constructor
SetupIntentCreateOptions.fromJson(
- Object? json
Implementation
factory SetupIntentCreateOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return SetupIntentCreateOptions(
attachToSelf: map['attach_to_self'] == null
? null
: (map['attach_to_self'] as bool),
automaticPaymentMethods: map['automatic_payment_methods'] == null
? null
: PaymentFlowsAutomaticPaymentMethodsPaymentIntent.fromJson(
map['automatic_payment_methods']),
confirm: map['confirm'] == null ? null : (map['confirm'] as bool),
confirmationToken: map['confirmation_token'] == null
? null
: (map['confirmation_token'] as String),
customer: map['customer'] == null ? null : (map['customer'] as String),
description:
map['description'] == null ? null : (map['description'] as String),
expand: map['expand'] == null
? null
: (map['expand'] as List<Object?>)
.map((el) => (el as String))
.toList(),
flowDirections: map['flow_directions'] == null
? null
: (map['flow_directions'] as List<Object?>)
.map((el) => SetupAttemptFlowDirectionsItem.fromJson(el))
.toList(),
mandateData: map['mandate_data'] == null
? null
: PaymentIntentMandateData.fromJson(map['mandate_data']),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
onBehalfOf:
map['on_behalf_of'] == null ? null : (map['on_behalf_of'] as String),
paymentMethod: map['payment_method'] == null
? null
: (map['payment_method'] as String),
paymentMethodConfiguration: map['payment_method_configuration'] == null
? null
: (map['payment_method_configuration'] as String),
paymentMethodData: map['payment_method_data'] == null
? null
: PaymentIntentPaymentMethodData.fromJson(map['payment_method_data']),
paymentMethodOptions: map['payment_method_options'] == null
? null
: SetupIntentCreateOptionsPaymentMethodOptions.fromJson(
map['payment_method_options']),
paymentMethodTypes: map['payment_method_types'] == null
? null
: (map['payment_method_types'] as List<Object?>)
.map((el) => (el as String))
.toList(),
returnUrl:
map['return_url'] == null ? null : (map['return_url'] as String),
singleUse: map['single_use'] == null
? null
: MandateSingleUse.fromJson(map['single_use']),
usage: map['usage'] == null
? null
: SessionSetupFutureUsage.fromJson(map['usage']),
useStripeSdk: map['use_stripe_sdk'] == null
? null
: (map['use_stripe_sdk'] as bool),
);
}