Customize redirect behavior
Display a confirmation page with your customer's order information.
If you have a Checkout integration that uses a Stripe-hosted page, Stripe redirects your customer to a success page that you create and host on your site. You can use the details from a Checkout Session to display an order confirmation page for your customer (for example, their name or payment amount) after the payment.
Redirect customers to a success page
To use the details from a Checkout Session:
- Modify the success_url to pass the Checkout Session ID to the client side.
- Look up the Checkout Session using the ID on your success page.
- Use the Checkout Session to customize what’s displayed on your success page.
Modify the success URL Server-side
Add the {CHECKOUT_
template variable to the success_
when you create the Checkout Session. Note that this is a literal string and must be added exactly as you see it here. Do not substitute it with a Checkout Session ID—this happens automatically after your customer pays and is redirected to the success page.
Create the success page Server-side
Look up the Checkout Session using the ID and create a success page to display the order information. This example prints out the customer’s name:
Test the integration
To confirm that your redirect is working as expected:
- Click the checkout button.
- Fill in the customer name and other payment details.
- Click Pay.
If it works, you’re redirected to the success page with your custom message. For example, if you used the message in the code samples, the success page displays this message: Thanks for your order, Jenny Rosen!