CustomerSheetInitParams class abstract

Parameters to setup a Customer sheet

For more info see https://stripe.com/docs/elements/customer-sheet?platform=react-native

Available extensions
Annotations
  • @freezed

Constructors

CustomerSheetInitParams({@JsonKey.new(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, required String customerId, required String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, @Default.new(true) bool applePayEnabled, @Default.new(true) bool googlePayEnabled, @JsonKey.new(toJson: _cardBrandListToJson) List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, bool? opensCardScannerAutomatically})
const
factory
CustomerSheetInitParams.adapter({String? setupIntentClientSecret, required String customerId, IntentConfiguration? intentConfiguration, String? customerEphemeralKeySecret, @JsonKey.new(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, @Default.new(true) bool applePayEnabled, @Default.new(true) bool googlePayEnabled, @JsonKey.new(toJson: _cardBrandListToJson) List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance})
const
factory
CustomerSheetInitParams.fromJson(Map<String, dynamic> json)
factory
CustomerSheetInitParams.session({String? setupIntentClientSecret, String? customerId, required IntentConfiguration intentConfiguration, String? customerEphemeralKeySecret, @JsonKey.new(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, @Default.new(true) bool applePayEnabled, @Default.new(true) bool googlePayEnabled, @JsonKey.new(toJson: _cardBrandListToJson) List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance})
const
factory

Properties

allowsRemovalOfLastSavedPaymentMethod bool?
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.
no setterinherited
appearance PaymentSheetAppearance?
Appearance of the customersheet.
no setterinherited
applePayEnabled bool
Whether to show Apple Pay as an option. Defaults to false.
no setterinherited
billingDetailsCollectionConfiguration BillingDetailsCollectionConfiguration?
Describes how billing details should be collected. All values default to AUTOMATIC. If NEVER is used for a required field for the Payment Method, you must provide an appropriate value as part of defaultBillingDetails.
no setterinherited
cardBrandAcceptance CardBrandAcceptance?
By default, PaymentSheet will accept all supported cards by Stripe. You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands.
no setterinherited
copyWith → $CustomerSheetInitParamsCopyWith<CustomerSheetInitParams>
Create a copy of CustomerSheetInitParams with the given fields replaced by the non-null parameter values.
no setterinherited
customerEphemeralKeySecret String?
A short-lived token that allows the SDK to access a Customer's payment methods.
no setterinherited
customerId String?
The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id
no setterinherited
defaultBillingDetails BillingDetails?
CustomerSheet pre-populates fields with the values provided. If billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod is true, these values will be attached to the payment method even if they are not collected by the CustomerSheet UI.
no setterinherited
googlePayEnabled bool
Whether to show Google Pay as an option. Defaults to false.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
headerTextForSelectionScreen String?
Optional configuration for setting the header text of the Payment Method selection screen
no setterinherited
merchantDisplayName String?
Your customer-facing business name. The default value is the name of your app.
no setterinherited
preferredNetworks List<CardBrand>?
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.
no setterinherited
removeSavedPaymentMethodMessage String?
Optional configuration to display a custom message when a saved payment method is removed. iOS only.
no setterinherited
returnURL String?
URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setupIntentClientSecret String?
Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps.
no setterinherited
style ThemeMode?
Color styling used for the Customersheet UI
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_CustomerSheetInitParamsDeprecated value), {required TResult adapter(_CustomerSheetInitParamsAdapter value), required TResult session(_CustomerSheetInitParamsSession value)}) → TResult

Available on CustomerSheetInitParams, provided by the CustomerSheetInitParamsPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_CustomerSheetInitParamsDeprecated value)?, {TResult? adapter(_CustomerSheetInitParamsAdapter value)?, TResult? session(_CustomerSheetInitParamsSession value)?}) → TResult?

Available on CustomerSheetInitParams, provided by the CustomerSheetInitParamsPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_CustomerSheetInitParamsDeprecated value)?, {TResult adapter(_CustomerSheetInitParamsAdapter value)?, TResult session(_CustomerSheetInitParamsSession value)?, required TResult orElse()}) → TResult

Available on CustomerSheetInitParams, provided by the CustomerSheetInitParamsPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, bool? opensCardScannerAutomatically)?, {TResult adapter(String? setupIntentClientSecret, String customerId, IntentConfiguration? intentConfiguration, String? customerEphemeralKeySecret, ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)?, TResult session(String? setupIntentClientSecret, String? customerId, IntentConfiguration intentConfiguration, String? customerEphemeralKeySecret, ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)?, required TResult orElse()}) → TResult

Available on CustomerSheetInitParams, provided by the CustomerSheetInitParamsPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this CustomerSheetInitParams to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, bool? opensCardScannerAutomatically), {required TResult adapter(String? setupIntentClientSecret, String customerId, IntentConfiguration? intentConfiguration, String? customerEphemeralKeySecret, ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance), required TResult session(String? setupIntentClientSecret, String? customerId, IntentConfiguration intentConfiguration, String? customerEphemeralKeySecret, ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)}) → TResult

Available on CustomerSheetInitParams, provided by the CustomerSheetInitParamsPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, bool? opensCardScannerAutomatically)?, {TResult? adapter(String? setupIntentClientSecret, String customerId, IntentConfiguration? intentConfiguration, String? customerEphemeralKeySecret, ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)?, TResult? session(String? setupIntentClientSecret, String? customerId, IntentConfiguration intentConfiguration, String? customerEphemeralKeySecret, ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)?}) → TResult?

Available on CustomerSheetInitParams, provided by the CustomerSheetInitParamsPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited