Class SetupIntent
- All Implemented Interfaces:
HasId,MetadataStore<SetupIntent>,StripeObjectInterface
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classThe type of the microdeposit sent to the customer.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncancel()A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.cancel(RequestOptions options) A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.cancel(SetupIntentCancelParams params) A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.cancel(SetupIntentCancelParams params, RequestOptions options) A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.cancel(Map<String, Object> params, RequestOptions options) A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.protected booleanconfirm()Confirm that your customer intends to set up the current or provided payment method.confirm(RequestOptions options) Confirm that your customer intends to set up the current or provided payment method.confirm(SetupIntentConfirmParams params) Confirm that your customer intends to set up the current or provided payment method.confirm(SetupIntentConfirmParams params, RequestOptions options) Confirm that your customer intends to set up the current or provided payment method.Confirm that your customer intends to set up the current or provided payment method.confirm(Map<String, Object> params, RequestOptions options) Confirm that your customer intends to set up the current or provided payment method.static SetupIntentcreate(SetupIntentCreateParams params) Creates a SetupIntent object.static SetupIntentcreate(SetupIntentCreateParams params, RequestOptions options) Creates a SetupIntent object.static SetupIntentCreates a SetupIntent object.static SetupIntentcreate(Map<String, Object> params, RequestOptions options) Creates a SetupIntent object.booleanGet ID of expandableapplicationobject.Get expandedapplication.If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.Reason for cancellation of this SetupIntent, one ofabandoned,requested_by_customer, orduplicate.The client secret of this SetupIntent.Time at which the object was created.Get ID of expandablecustomerobject.Get expandedcustomer.An arbitrary string attached to the object.Indicates the directions of money movement for which this payment method is intended to be used.getId()Unique identifier for the object.The error encountered in the previous SetupIntent confirmation.Get ID of expandablelatestAttemptobject.Get expandedlatestAttempt.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.Get ID of expandablemandateobject.Get expandedmandate.Set of key-value pairs that you can attach to an object.If present, this property tells you what actions you need to take in order for your customer to continue payment setup.String representing the object's type.Get ID of expandableonBehalfOfobject.Get expandedonBehalfOf.Get ID of expandablepaymentMethodobject.Get expandedpaymentMethod.Payment-method-specific configuration for this SetupIntent.The list of payment method types (e.g.Get ID of expandablesingleUseMandateobject.Get expandedsingleUseMandate.Status of this SetupIntent, one ofrequires_payment_method,requires_confirmation,requires_action,processing,canceled, orsucceeded.getUsage()Indicates how the payment method is intended to be used in the future.inthashCode()static SetupIntentCollectionlist(SetupIntentListParams params) Returns a list of SetupIntents.static SetupIntentCollectionlist(SetupIntentListParams params, RequestOptions options) Returns a list of SetupIntents.static SetupIntentCollectionReturns a list of SetupIntents.static SetupIntentCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of SetupIntents.static SetupIntentRetrieves the details of a SetupIntent that has previously been created.static SetupIntentretrieve(String intent, RequestOptions options) Retrieves the details of a SetupIntent that has previously been created.static SetupIntentretrieve(String intent, SetupIntentRetrieveParams params, RequestOptions options) Retrieves the details of a SetupIntent that has previously been created.static SetupIntentRetrieves the details of a SetupIntent that has previously been created.voidsetApplication(String id) voidsetApplicationObject(Application expandableObject) voidsetAttachToSelf(Boolean attachToSelf) If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.voidsetCancellationReason(String cancellationReason) Reason for cancellation of this SetupIntent, one ofabandoned,requested_by_customer, orduplicate.voidsetClientSecret(String clientSecret) The client secret of this SetupIntent.voidsetCreated(Long created) Time at which the object was created.voidsetCustomer(String id) voidsetCustomerObject(Customer expandableObject) voidsetDescription(String description) An arbitrary string attached to the object.voidsetFlowDirections(List<String> flowDirections) Indicates the directions of money movement for which this payment method is intended to be used.voidUnique identifier for the object.voidsetLastSetupError(StripeError lastSetupError) The error encountered in the previous SetupIntent confirmation.voidvoidsetLatestAttemptObject(SetupAttempt expandableObject) voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMandate(String id) voidsetMandateObject(Mandate expandableObject) voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidsetNextAction(SetupIntent.NextAction nextAction) If present, this property tells you what actions you need to take in order for your customer to continue payment setup.voidString representing the object's type.voidsetOnBehalfOf(String id) voidsetOnBehalfOfObject(Account expandableObject) voidvoidsetPaymentMethodObject(PaymentMethod expandableObject) voidsetPaymentMethodOptions(SetupIntent.PaymentMethodOptions paymentMethodOptions) Payment-method-specific configuration for this SetupIntent.voidsetPaymentMethodTypes(List<String> paymentMethodTypes) The list of payment method types (e.g.voidvoidsetSingleUseMandateObject(Mandate expandableObject) voidStatus of this SetupIntent, one ofrequires_payment_method,requires_confirmation,requires_action,processing,canceled, orsucceeded.voidIndicates how the payment method is intended to be used in the future.update(SetupIntentUpdateParams params) Updates a SetupIntent object.update(SetupIntentUpdateParams params, RequestOptions options) Updates a SetupIntent object.Updates a SetupIntent object.update(Map<String, Object> params, RequestOptions options) Updates a SetupIntent object.Verifies microdeposits on a SetupIntent object.verifyMicrodeposits(RequestOptions options) Verifies microdeposits on a SetupIntent object.Verifies microdeposits on a SetupIntent object.verifyMicrodeposits(SetupIntentVerifyMicrodepositsParams params, RequestOptions options) Verifies microdeposits on a SetupIntent object.verifyMicrodeposits(Map<String, Object> params) Verifies microdeposits on a SetupIntent object.verifyMicrodeposits(Map<String, Object> params, RequestOptions options) Verifies microdeposits on a SetupIntent object.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, requestSearchResult, requestSearchResult, requestStream, requestStream, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
Constructor Details
-
SetupIntent
public SetupIntent()
-
-
Method Details
-
getApplication
Get ID of expandableapplicationobject. -
setApplication
-
getApplicationObject
Get expandedapplication. -
setApplicationObject
-
getCustomer
Get ID of expandablecustomerobject. -
setCustomer
-
getCustomerObject
Get expandedcustomer. -
setCustomerObject
-
getLatestAttempt
Get ID of expandablelatestAttemptobject. -
setLatestAttempt
-
getLatestAttemptObject
Get expandedlatestAttempt. -
setLatestAttemptObject
-
getMandate
Get ID of expandablemandateobject. -
setMandate
-
getMandateObject
Get expandedmandate. -
setMandateObject
-
getOnBehalfOf
Get ID of expandableonBehalfOfobject. -
setOnBehalfOf
-
getOnBehalfOfObject
Get expandedonBehalfOf. -
setOnBehalfOfObject
-
getPaymentMethod
Get ID of expandablepaymentMethodobject. -
setPaymentMethod
-
getPaymentMethodObject
Get expandedpaymentMethod. -
setPaymentMethodObject
-
getSingleUseMandate
Get ID of expandablesingleUseMandateobject. -
setSingleUseMandate
-
getSingleUseMandateObject
Get expandedsingleUseMandate. -
setSingleUseMandateObject
-
cancel
A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error.
- Throws:
StripeException
-
cancel
A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error.
- Throws:
StripeException
-
cancel
A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error.
- Throws:
StripeException
-
cancel
A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error.
- Throws:
StripeException
-
cancel
A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error.
- Throws:
StripeException
-
cancel
public SetupIntent cancel(SetupIntentCancelParams params, RequestOptions options) throws StripeException A SetupIntent object can be canceled when it is in one of these statuses:requires_payment_method,requires_confirmation, orrequires_action.Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error.
- Throws:
StripeException
-
confirm
Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website.If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the
succeededstatus.Otherwise, it will transition to the
requires_actionstatus and suggest additional actions vianext_action. If setup fails, the SetupIntent will transition to therequires_payment_methodstatus.- Throws:
StripeException
-
confirm
Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website.If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the
succeededstatus.Otherwise, it will transition to the
requires_actionstatus and suggest additional actions vianext_action. If setup fails, the SetupIntent will transition to therequires_payment_methodstatus.- Throws:
StripeException
-
confirm
Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website.If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the
succeededstatus.Otherwise, it will transition to the
requires_actionstatus and suggest additional actions vianext_action. If setup fails, the SetupIntent will transition to therequires_payment_methodstatus.- Throws:
StripeException
-
confirm
public SetupIntent confirm(Map<String, Object> params, RequestOptions options) throws StripeExceptionConfirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website.If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the
succeededstatus.Otherwise, it will transition to the
requires_actionstatus and suggest additional actions vianext_action. If setup fails, the SetupIntent will transition to therequires_payment_methodstatus.- Throws:
StripeException
-
confirm
Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website.If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the
succeededstatus.Otherwise, it will transition to the
requires_actionstatus and suggest additional actions vianext_action. If setup fails, the SetupIntent will transition to therequires_payment_methodstatus.- Throws:
StripeException
-
confirm
public SetupIntent confirm(SetupIntentConfirmParams params, RequestOptions options) throws StripeException Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website.If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the
succeededstatus.Otherwise, it will transition to the
requires_actionstatus and suggest additional actions vianext_action. If setup fails, the SetupIntent will transition to therequires_payment_methodstatus.- Throws:
StripeException
-
create
Creates a SetupIntent object.After the SetupIntent is created, attach a payment method and confirm to collect any required permissions to charge the payment method later.
- Throws:
StripeException
-
create
public static SetupIntent create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a SetupIntent object.After the SetupIntent is created, attach a payment method and confirm to collect any required permissions to charge the payment method later.
- Throws:
StripeException
-
create
Creates a SetupIntent object.After the SetupIntent is created, attach a payment method and confirm to collect any required permissions to charge the payment method later.
- Throws:
StripeException
-
create
public static SetupIntent create(SetupIntentCreateParams params, RequestOptions options) throws StripeException Creates a SetupIntent object.After the SetupIntent is created, attach a payment method and confirm to collect any required permissions to charge the payment method later.
- Throws:
StripeException
-
list
Returns a list of SetupIntents.- Throws:
StripeException
-
list
public static SetupIntentCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of SetupIntents.- Throws:
StripeException
-
list
Returns a list of SetupIntents.- Throws:
StripeException
-
list
public static SetupIntentCollection list(SetupIntentListParams params, RequestOptions options) throws StripeException Returns a list of SetupIntents.- Throws:
StripeException
-
retrieve
Retrieves the details of a SetupIntent that has previously been created.Client-side retrieval using a publishable key is allowed when the
client_secretis provided in the query string.When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the SetupIntent object reference for more details.
- Throws:
StripeException
-
retrieve
Retrieves the details of a SetupIntent that has previously been created.Client-side retrieval using a publishable key is allowed when the
client_secretis provided in the query string.When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the SetupIntent object reference for more details.
- Throws:
StripeException
-
retrieve
public static SetupIntent retrieve(String intent, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the details of a SetupIntent that has previously been created.Client-side retrieval using a publishable key is allowed when the
client_secretis provided in the query string.When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the SetupIntent object reference for more details.
- Throws:
StripeException
-
retrieve
public static SetupIntent retrieve(String intent, SetupIntentRetrieveParams params, RequestOptions options) throws StripeException Retrieves the details of a SetupIntent that has previously been created.Client-side retrieval using a publishable key is allowed when the
client_secretis provided in the query string.When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the SetupIntent object reference for more details.
- Throws:
StripeException
-
update
Updates a SetupIntent object.- Specified by:
updatein interfaceMetadataStore<SetupIntent>- Throws:
StripeException
-
update
Updates a SetupIntent object.- Specified by:
updatein interfaceMetadataStore<SetupIntent>- Throws:
StripeException
-
update
Updates a SetupIntent object.- Throws:
StripeException
-
update
public SetupIntent update(SetupIntentUpdateParams params, RequestOptions options) throws StripeException Updates a SetupIntent object.- Throws:
StripeException
-
verifyMicrodeposits
Verifies microdeposits on a SetupIntent object.- Throws:
StripeException
-
verifyMicrodeposits
Verifies microdeposits on a SetupIntent object.- Throws:
StripeException
-
verifyMicrodeposits
Verifies microdeposits on a SetupIntent object.- Throws:
StripeException
-
verifyMicrodeposits
public SetupIntent verifyMicrodeposits(Map<String, Object> params, RequestOptions options) throws StripeExceptionVerifies microdeposits on a SetupIntent object.- Throws:
StripeException
-
verifyMicrodeposits
public SetupIntent verifyMicrodeposits(SetupIntentVerifyMicrodepositsParams params) throws StripeException Verifies microdeposits on a SetupIntent object.- Throws:
StripeException
-
verifyMicrodeposits
public SetupIntent verifyMicrodeposits(SetupIntentVerifyMicrodepositsParams params, RequestOptions options) throws StripeException Verifies microdeposits on a SetupIntent object.- Throws:
StripeException
-
getAttachToSelf
If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
-
getCancellationReason
Reason for cancellation of this SetupIntent, one ofabandoned,requested_by_customer, orduplicate. -
getClientSecret
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.
-
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
getFlowDirections
Indicates the directions of money movement for which this payment method is intended to be used.Include
inboundif you intend to use the payment method as the origin to pull funds from. Includeoutboundif you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. -
getLastSetupError
The error encountered in the previous SetupIntent confirmation. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getNextAction
If present, this property tells you what actions you need to take in order for your customer to continue payment setup. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
setup_intent. -
getPaymentMethodOptions
Payment-method-specific configuration for this SetupIntent. -
getPaymentMethodTypes
The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. -
getStatus
Status of this SetupIntent, one ofrequires_payment_method,requires_confirmation,requires_action,processing,canceled, orsucceeded. -
getUsage
Indicates how the payment method is intended to be used in the future.Use
on_sessionif you intend to only reuse the payment method when the customer is in your checkout flow. Useoff_sessionif your customer may or may not be in your checkout flow. If not provided, this value defaults tooff_session. -
setAttachToSelf
If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
-
setCancellationReason
Reason for cancellation of this SetupIntent, one ofabandoned,requested_by_customer, orduplicate. -
setClientSecret
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.
-
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
setFlowDirections
Indicates the directions of money movement for which this payment method is intended to be used.Include
inboundif you intend to use the payment method as the origin to pull funds from. Includeoutboundif you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. -
setId
Unique identifier for the object. -
setLastSetupError
The error encountered in the previous SetupIntent confirmation. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setMetadata
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. -
setNextAction
If present, this property tells you what actions you need to take in order for your customer to continue payment setup. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
setup_intent. -
setPaymentMethodOptions
Payment-method-specific configuration for this SetupIntent. -
setPaymentMethodTypes
The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. -
setStatus
Status of this SetupIntent, one ofrequires_payment_method,requires_confirmation,requires_action,processing,canceled, orsucceeded. -
setUsage
Indicates how the payment method is intended to be used in the future.Use
on_sessionif you intend to only reuse the payment method when the customer is in your checkout flow. Useoff_sessionif your customer may or may not be in your checkout flow. If not provided, this value defaults tooff_session. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
getMetadata
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.- Specified by:
getMetadatain interfaceMetadataStore<SetupIntent>
-