#elswift
1 messages · Page 1 of 1 (latest)
At what point do you run into this error?
when i click on "buy" on my frontend, i am supposed to be redirected to the checkout (which is what happens on the local web/back version).
Also :
this is the network log
And i verified, the env variables are set in the live back-end :
Hm, are you sure you've saved this and restarted your server? If you hard code your secret key (don't share it here), does the redirect work?
yep doesn't work 😦
Wait, hold on. I missed this from earlier but Checkout Sessions can only be created server side, not client side
How are you handling the redirect?
The code that creates the checkout is server side don't worry. The session is sent to the client. And it works in localhost (the webhook of payment event too, cancel order too...).
Do you get a different error if you hard code your secret key?
this is how the web front redirects :
oh, I see you're using the deprecated redirectToCheckout
I recommend following this guide instead: https://stripe.com/docs/checkout/quickstart
Oh okay thank you ! Can this post not be archived while i fix that ? Do you think it is the source of my issue ?