Customise redirect behaviour
Display a confirmation page with your customer's order information.
You can customise how and whether Stripe redirects your customers after they complete payment. You can make Stripe always redirect customers or only redirect for some payment methods.
To set up redirects, specify the return page:
- In the return_url when you create the Checkout Session on your server
- In the returnUrl when you confirm the Checkout Session on the client.
Or you can redirect customers only if the payment method requires it (for example, a bank authorisation page for a debit-based method).
Webhooks are required for fulfilment
You can’t rely on triggering fulfilment only from your checkout landing page, because your customers aren’t guaranteed to visit that page. For example, someone can pay successfully and then lose their connection to the internet before your landing page loads.
Set up a webhook event handler so Stripe can send payment events directly to your server, bypassing the client entirely. Webhooks provide the most reliable way to confirm when you get paid. If webhook event delivery fails, Stripe retries multiple times.
Redirect customers to a return page
When you create the Checkout Session, specify the URL of the return page in the return_url. You can add the {CHECKOUT_
template variable to the return_
to include the ID of the completed Checkout Session. This is a literal string and you must add it exactly as you see here. Don’t substitute it with a Checkout Session ID, which happens automatically after your customer pays and is redirected to the return page.
Redirect-based payment methods
During payment, some payment methods redirect the customer to an intermediate page, such as a bank authorisation page. When they complete that page, Stripe redirects them to your return page.
To only redirect the customer to your return page if they’re redirected to an intermediate page, set redirect: 'if_
when you confirm the Checkout Session.