PaymentIntentConfirmOptions.fromJson constructor

PaymentIntentConfirmOptions.fromJson(
  1. Object? json
)

Implementation

factory PaymentIntentConfirmOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentIntentConfirmOptions(
    captureMethod: map['capture_method'] == null
        ? null
        : PaymentIntentCaptureMethod.fromJson(map['capture_method']),
    confirmationToken: map['confirmation_token'] == null
        ? null
        : (map['confirmation_token'] as String),
    errorOnRequiresAction: map['error_on_requires_action'] == null
        ? null
        : (map['error_on_requires_action'] as bool),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    mandate: map['mandate'] == null ? null : (map['mandate'] as String),
    mandateData: map['mandate_data'] == null
        ? null
        : PaymentIntentConfirmOptionsMandateData.fromJson(
            map['mandate_data']),
    offSession: map['off_session'] == null
        ? null
        : PaymentIntentOffSession.fromJson(map['off_session']),
    paymentMethod: map['payment_method'] == null
        ? null
        : (map['payment_method'] as String),
    paymentMethodData: map['payment_method_data'] == null
        ? null
        : PaymentIntentPaymentMethodData.fromJson(map['payment_method_data']),
    paymentMethodOptions: map['payment_method_options'] == null
        ? null
        : PaymentIntentCreateOptionsPaymentMethodOptions.fromJson(
            map['payment_method_options']),
    radarOptions: map['radar_options'] == null
        ? null
        : RadarRadarOptions.fromJson(map['radar_options']),
    receiptEmail: map['receipt_email'] == null
        ? null
        : (map['receipt_email'] as String),
    returnUrl:
        map['return_url'] == null ? null : (map['return_url'] as String),
    setupFutureUsage: map['setup_future_usage'] == null
        ? null
        : PaymentIntentUpdateOptionsSetupFutureUsage.fromJson(
            map['setup_future_usage']),
    shipping: map['shipping'] == null
        ? null
        : ChargeCreateOptionsShipping.fromJson(map['shipping']),
    useStripeSdk: map['use_stripe_sdk'] == null
        ? null
        : (map['use_stripe_sdk'] as bool),
  );
}