SetupPaymentSheetParameters constructor
- @JsonSerializable(explicitToJson: true)
const
SetupPaymentSheetParameters(
{ - @Default(false) bool customFlow,
- String? customerId,
- String? primaryButtonLabel,
- String? customerEphemeralKeySecret,
- String? customerSessionClientSecret,
- String? paymentIntentClientSecret,
- String? setupIntentClientSecret,
- IntentConfiguration? intentConfiguration,
- String? merchantDisplayName,
- PaymentSheetApplePay? applePay,
- @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style,
- PaymentSheetGooglePay? googlePay,
- @Default(false) bool allowsDelayedPaymentMethods,
- PaymentSheetAppearance? appearance,
- @JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails,
- bool? allowsRemovalOfLastSavedPaymentMethod,
- List<String>? paymentMethodOrder,
- String? returnURL,
- BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration,
- String? removeSavedPaymentMethodMessage,
- @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,
/// (Experimental) This parameter can be changed or removed at any time (use at your own risk).
/// The client secret of this Customer Session. Used on the client to set up secure access to the given customer.
String? customerSessionClientSecret,
/// 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,
///This is an experimental feature that may be removed at any time.
/// Defaults to true. If true, the customer can delete all saved payment methods.
/// If false, the customer can't delete if they only have one saved payment method remaining.
bool? allowsRemovalOfLastSavedPaymentMethod,
/// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer.
/// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types.
/// See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods.
/// Example: ["card", "external_paypal", "klarna"]
/// If you omit payment methods from this list, they’ll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored.
List<String>? paymentMethodOrder,
/// 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;