SetupIntent class final

SetupIntent

A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment\_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in [certain regions](/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup\_intent\_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment\_intent\_object-setup\_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents)

Implemented types

Constructors

SetupIntent({ApplicationOrId? application, bool? attachToSelf, PaymentFlowsAutomaticPaymentMethodsSetupIntent? automaticPaymentMethods, SetupIntentCancellationReason? cancellationReason, String? clientSecret, required DateTime created, BankAccountCustomerOrId? customer, String? description, List<SetupAttemptFlowDirectionsItem>? flowDirections, required String id, ApiErrors? lastSetupError, SetupAttemptOrId? latestAttempt, required bool livemode, MandateOrId? mandate, Map<String, String>? metadata, SetupIntentNextAction? nextAction, AccountOrId? onBehalfOf, PaymentMethodOrId? paymentMethod, PaymentMethodConfigBizPaymentMethodConfigurationDetails? paymentMethodConfigurationDetails, SetupIntentPaymentMethodOptions? paymentMethodOptions, required List<String> paymentMethodTypes, MandateOrId? singleUseMandate, required SetupIntentStatus status, required String usage})
SetupIntent
const
SetupIntent.fromJson(Object? json)
factory

Properties

application → ApplicationOrId?
final
attachToSelf → bool?
final
automaticPaymentMethods → PaymentFlowsAutomaticPaymentMethodsSetupIntent?
final
cancellationReason → SetupIntentCancellationReason?
final
clientSecret → String?
final
created → DateTime
final
customer → BankAccountCustomerOrId?
final
description → String?
final
flowDirections → List<SetupAttemptFlowDirectionsItem>?
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
The ID of the SetupIntent.
final
lastSetupError → ApiErrors?
final
latestAttempt → SetupAttemptOrId?
final
livemode → bool
final
mandate → MandateOrId?
final
metadata → Map<String, String>?
final
nextAction → SetupIntentNextAction?
If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
final
object → String
The resource's type.
final
onBehalfOf → AccountOrId?
final
paymentMethod → PaymentMethodOrId?
final
paymentMethodConfigurationDetails → PaymentMethodConfigBizPaymentMethodConfigurationDetails?
final
paymentMethodOptions → SetupIntentPaymentMethodOptions?
Payment method-specific configuration for this SetupIntent.
final
paymentMethodTypes → List<String>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
singleUseMandate → MandateOrId?
final
status → SetupIntentStatus
final
usage → String
final

Methods

encodeWith<V>(Encoder<V> encoder) → V
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
override
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

encode<V>(SetupIntent instance, Encoder<V> encoder) → V
override