ConfirmationTokenCreateOptions.fromJson constructor

ConfirmationTokenCreateOptions.fromJson(
  1. Object? json
)

Implementation

factory ConfirmationTokenCreateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return ConfirmationTokenCreateOptions(
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    paymentMethod: map['payment_method'] == null
        ? null
        : (map['payment_method'] as String),
    paymentMethodData: map['payment_method_data'] == null
        ? null
        : PaymentIntentPaymentMethodData.fromJson(map['payment_method_data']),
    returnUrl:
        map['return_url'] == null ? null : (map['return_url'] as String),
    setupFutureUsage: map['setup_future_usage'] == null
        ? null
        : SessionSetupFutureUsage.fromJson(map['setup_future_usage']),
    shipping: map['shipping'] == null
        ? null
        : InvoiceShippingDetails.fromJson(map['shipping']),
  );
}