SetupPaymentSheetParameters constructor

  1. @JsonSerializable(explicitToJson: true)
const SetupPaymentSheetParameters({
  1. @Default(false) bool customFlow,
  2. String? customerId,
  3. String? primaryButtonLabel,
  4. String? customerEphemeralKeySecret,
  5. String? paymentIntentClientSecret,
  6. String? setupIntentClientSecret,
  7. IntentConfiguration? intentConfiguration,
  8. String? merchantDisplayName,
  9. PaymentSheetApplePay? applePay,
  10. @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style,
  11. PaymentSheetGooglePay? googlePay,
  12. @Default(false) bool allowsDelayedPaymentMethods,
  13. PaymentSheetAppearance? appearance,
  14. @JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails,
  15. String? returnURL,
  16. BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration,
  17. String? removeSavedPaymentMethodMessage,
  18. @JsonKey(toJson: _cardBrandListToJson) List<CardBrand>? preferredNetworks,
})

Implementation

@JsonSerializable(explicitToJson: true)
const factory SetupPaymentSheetParameters({
  /// Whether or not to use a custom flow.
  ///
  /// If this value is true, the payment sheet will allow to select a payment method
  /// and a later confirmation will be needed by calling [confirmPaymentSheetPayment]
  /// By default, false.
  @Default(false) bool customFlow,

  /// The identifier of the Stripe Customer object.
  /// See https://stripe.com/docs/api/customers/object#customer_object-id
  String? customerId,

  ///  The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents
  String? primaryButtonLabel,

  ///A temp key can be used for API operations that require a secret key.
  String? customerEphemeralKeySecret,

  /// Secret used for client-side retrieval using a publishable key.
  ///
  /// If this value is null make sure to add a [setupIntentClientSecret]
  String? paymentIntentClientSecret,

  /// The client secret of this SetupIntent
  ///
  /// If this value is null make sure to add a [paymentIntentClientSecret]

  String? setupIntentClientSecret,

  /// Use this when you want to collect payment information before creating a
  /// setupintent or payment intent.
  IntentConfiguration? intentConfiguration,

  /// Display name of the merchant
  String? merchantDisplayName,

  /// Configuration related to Apple Pay
  /// If set, PaymentSheet displays Apple Pay as a payment option
  PaymentSheetApplePay? applePay,

  /// iOS only style options for colors in PaymentSheet
  ///
  /// Parts can be overridden by [appearance].
  @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style,

  /// Configuration related to Google Pay
  /// If set, PaymentSheet displays Google Pay as a payment option
  PaymentSheetGooglePay? googlePay,

  /// Flag that allows payment methods that do not move money at the send of the checkout.
  ///
  /// Defaul value is false.
  @Default(false) bool allowsDelayedPaymentMethods,

  /// Appearance of the paymentsheet.
  ///
  /// When no appearance defined it will fallback to [style] or Stripe default.
  PaymentSheetAppearance? appearance,

  /// Default billing information of the customer.
  ///
  /// Use this field to already prefill the customers billingDetails in the payment sheet.
  /// For example when you supply a country the country will be set on the payment sheet +
  /// alternative localization options. This does not set the billingDetails on the
  /// paymentIntent since the customer can change those.
  @JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails,

  /// Return URL is required for IDEAL, Klarna and few other payment methods
  String? returnURL,

  /// Configuration for how billing details are collected during checkout.
  BillingDetailsCollectionConfiguration?
      billingDetailsCollectionConfiguration,

  ///  Optional configuration to display a custom message when a saved payment method is removed. iOS only.
  String? removeSavedPaymentMethodMessage,

  /// The list of preferred networks that should be used to process payments made with a co-branded card.
  /// This value will only be used if your user hasn't selected a network themselves.
  @JsonKey(toJson: _cardBrandListToJson) List<CardBrand>? preferredNetworks,
}) = _SetupParameters;