Set up future the related setting recurring payments
Save your customer's the related setting payment method for future recurring payments without an initial payment.
Use a SetupIntent to save a customer’s the related setting payment method for future recurring payments without charging them up front. Set usage to off_session on the SetupIntent to save the related setting for off-session recurring payments. After the customer authorizes the setup in their banking app, you can charge them off-session using the saved payment method.
Checkout
Elements
Direct API
Create a Checkout Session Server-side
Create a Checkout Session in setup mode. Enable the related setting in your Dashboard. Stripe automatically selects eligible payment methods.
Command Line
Select a language
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
The customer enters their the related setting code and approves the mandate authorization in their banking app. After the session completes, a reusable the related setting PaymentMethod is attached to the Customer.
Charge the saved the related setting PaymentMethod later Server-side
After you save a the related setting payment method, you can use it to charge the customer off-session without making them enter a new the related setting code.
Create a PaymentIntent with off_session set to true and the saved PaymentMethod and Customer IDs.
Command Line
Select a language
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
After confirming the PaymentIntent, it initiates a payment. The next_action has the blik_authorize type, which means that the next step is completed by the customer’s bank, who validates the payment against the terms of the original mandate. We recommend showing a timer or a dialog to your customer and polling your server or the Stripe API for the PaymentIntent status update.
Caution
You must listen for webhooks to determine the final payment status. Use the payment_intent.succeeded and payment_intent.payment_failed events to handle the outcome.
Handling failures
If the customer’s bank declines the payment, the PaymentIntent transitions to requires_payment_method. To resolve a failed off-session payment, you can bring the customer back on session and collect a new payment method, or retry the payment if the failure was transient.
Simulate failures in a sandbox
In addition to the one-time payment test patterns, you can simulate recurring-specific scenarios by passing email values matching the patterns below when creating the SetupIntent or PaymentIntent, as part of the billing details.
Mandate setup failures (immediate)
| Error code | Decline code | Explanation | Email pattern |
|---|---|---|---|
payment_method_provider_decline | recurring_not_supported_by_bank | The customer’s bank doesn’t support the related setting recurring payments. | .*recurring_not_supported@.* |
Mandate setup failures (60 second delay)
| Event produced | Explanation | Email pattern |
|---|---|---|
mandate.updated (pending to inactive) | The customer didn’t complete the mandate setup in their banking app. | .*setup_timeout@.* |
Mandate lifecycle events (6 minute delay)
These patterns simulate events that occur after a mandate has been successfully set up.
| Event produced | Explanation | Email pattern |
|---|---|---|
mandate.updated (active to inactive) | The customer removed the saved payment method from their banking app. | .*alias_unregistered@.* |
mandate.updated (active to inactive) | The mandate reached its expiration date. | .*alias_expired@.* |
Off-session payment failures (immediate)
These patterns affect off-session payments made with a saved the related setting payment method.
| Error code | Decline code | Explanation | Email pattern |
|---|---|---|---|
payment_method_provider_decline | generic_decline | The mandate setup succeeds, but all subsequent off-session payments are declined. | .*recurring_declined@.* |
payment_method_provider_decline | generic_decline | The off-session payment is declined and the mandate is revoked. The saved payment method can no longer be used. | .*alias_declined@.* |
