#moony
1 messages · Page 1 of 1 (latest)
hey there unfortunately you can't redirect the Axios post request
instead you can return that session URL back to the client and then redirect client side
using for example window.location or the appropriate redirect mechanism for your framework
Hey there, thank's for your answer but could you maybe give me a quick small example?
SUre, where you have res.redirect(303, session.url); you could instead do eg res.send({ url: session.url });
Okay, will try, thank's! 🙂
then in the client you're receive that and use something like window.location.href = url
thank you
NP!
Sorry, one more question. Should it look like this then? res.send({ url: '/api/checkout_sessions'}); and the window.location.href = '/api/checkout_sessions' ?
No, the url is unique for each session after you create it -- its the same session.url you were initially redirecting to
ok