#ab365
1 messages · Page 1 of 1 (latest)
Now we actually recommend doing a normal redirect with the checkout session's URL. You can access it on the checkout object itself https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-url
And then do a 303 redirect from your server or a normal javascript redirect client side
redirectToCheckout would still work but it has more moving parts and more ways it can break. The simple redirects work better and more consistently which is why we deprecated it
Yes, either of those should work with next.js
is there any videos explaining how to do it ? might be easier than the docs
Unfortunately I'm not as familiar with next.js though I did find this doc when quickly looking https://nextjs.org/docs/api-reference/next.config.js/redirects
Here is how to do it in vanilla javascript if you can still use that there
https://www.w3schools.com/howto/howto_js_redirect_webpage.asp
The 303 redirect one would probably be easiest but how exactly to do it depends on your server side code. If you search "303 redirect {your_server_frame_work}" there should be something on how to do it. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303