View Source ExOAPI.Stripe.Schemas.SetupIntent (exoapi_stripe v0.1.4)
description: A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment. Later, you can use PaymentIntents to drive the payment flow.
Create a SetupIntent as soon as you're ready to collect your customer's payment credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid. The SetupIntent then transitions through multiple 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 may need to be run through Strong Customer Authentication at the time of payment method collection in order to streamline later off-session payments. If the SetupIntent is used with a Customer, upon success, it will automatically attach the resulting payment method to that Customer. We recommend using SetupIntents or setup_future_usage on PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods.
By using SetupIntents, you ensure that your customers experience the minimum set of required friction, even as regulations change over time.
Related guide: Setup Intents API.
:application :: ExOAPI.Stripe.Schemas.Application | :string
ID of the Connect application that created the SetupIntent.
:cancellation_reason :: :string
Reason for cancellation of this SetupIntent, one of abandoned
, requested_by_customer
, or duplicate
.
:client_secret :: :string
The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
:created :: :integer
Time at which the object was created. Measured in seconds since the Unix epoch.
:customer :: ExOAPI.Stripe.Schemas.DeletedCustomer | ExOAPI.Stripe.Schemas.Customer | :string
ID of the Customer this SetupIntent belongs to, if one exists.
If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.
:description :: :string
An arbitrary string attached to the object. Often useful for displaying to users.
:id :: :string
Unique identifier for the object.
:last_setup_error :: ExOAPI.Stripe.Schemas.ApiErrors
The error encountered in the previous SetupIntent confirmation.
:latest_attempt :: ExOAPI.Stripe.Schemas.SetupAttempt | :string
The most recent SetupAttempt for this SetupIntent.
:livemode :: :boolean
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
:mandate :: ExOAPI.Stripe.Schemas.Mandate | :string
ID of the multi use Mandate generated by the SetupIntent.
:metadata :: :map
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
:next_action :: ExOAPI.Stripe.Schemas.SetupIntentNextAction
If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
:object :: :string
String representing the object's type. Objects of the same type share the same value.
:on_behalf_of :: ExOAPI.Stripe.Schemas.Account | :string
The account (if any) for which the setup is intended.
:payment_method :: ExOAPI.Stripe.Schemas.PaymentMethod | :string
ID of the payment method used with this SetupIntent.
:payment_method_options :: ExOAPI.Stripe.Schemas.SetupIntentPaymentMethodOptions
Payment-method-specific configuration for this SetupIntent.
::payment_method_types :: :string
:single_use_mandate :: ExOAPI.Stripe.Schemas.Mandate | :string
ID of the single_use Mandate generated by the SetupIntent.
:status :: :string
Status of this SetupIntent, one of requires_payment_method
, requires_confirmation
, requires_action
, processing
, canceled
, or succeeded
.
:usage :: :string
Indicates how the payment method is intended to be used in the future.
Use on_session
if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session
if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session
.
Link to this section Summary
Link to this section Types
@type params() :: map()
@type t() :: %ExOAPI.Stripe.Schemas.SetupIntent{ application: ExOAPI.EctoTypes.AnyOf.t() | nil, cancellation_reason: (:requested_by_customer | :duplicate | :abandoned) | nil, client_secret: String.t() | nil, created: integer() | nil, customer: ExOAPI.EctoTypes.AnyOf.t() | nil, description: String.t() | nil, id: String.t() | nil, last_setup_error: ExOAPI.EctoTypes.AnyOf.t() | nil, latest_attempt: ExOAPI.EctoTypes.AnyOf.t() | nil, livemode: boolean() | nil, mandate: ExOAPI.EctoTypes.AnyOf.t() | nil, metadata: map() | nil, next_action: ExOAPI.EctoTypes.AnyOf.t() | nil, object: :setup_intent | nil, on_behalf_of: ExOAPI.EctoTypes.AnyOf.t() | nil, payment_method: ExOAPI.EctoTypes.AnyOf.t() | nil, payment_method_options: ExOAPI.EctoTypes.AnyOf.t() | nil, payment_method_types: [String.t()] | nil, single_use_mandate: ExOAPI.EctoTypes.AnyOf.t() | nil, status: (:succeeded | :requires_payment_method | :requires_confirmation | :requires_action | :processing | :canceled) | nil, usage: String.t() | nil }
Link to this section Functions
@spec changeset(t(), params()) :: Ecto.Changeset.t()