#Ivan-Checkout
1 messages · Page 1 of 1 (latest)
Hi Ivan, when you move the live mode, did you also update the publishable key in your frontend app?
Yes, both keys, public in frontend and secret in backend.
Thanks for your response.
OK, can you create a new checkout session in live mode and pass me the checkout session ID?
OK, I can see this checkout session is created successfully.
You can simply use the checkout session's url property to open the checkout page/
You can also use stripe.redirectCheckout to open the checkout page, but you need to make sure that that publishable key is correct
The line stripe. redirecttocheckout is never reached with live keys
I've deleted the message because there's live key in it
please avoid posting your live key in Discord
Sorry, it was the public key.
If i don´t make you wrong, you suggest me to redirect from server side right?
I´m gonna try to do it.
But, how could I know why is this happenning?
Would you try to revoke the public key?
and create it again
can you post the code again without your secret key?
var stripe = Stripe('XXXXXXXXXXXXXX');
var form = document.getElementById("form1");
form.addEventListener('submit', function (e) {
e.preventDefault();
stripe.redirectToCheckout({
sessionId: "<%= stripeSessionId %>"
})
})
OK, your code looks good to me, can you double check if the XXXXXXXXX is the correct publishable key?
100% sure.
Double checked now, but i´ve been with this the whole weekend.
OK, can you check the promise returned from stripe.redirectToCheckot and see if there's any error?
This line is never reached in live mode.
This is the problem
Do you have a public webpage where I can reproduce the problem?
yes
http://gptwinscripcionevento.azurewebsites.net/
Select "premiados best workplaces"
then fill the fields with anything
And finally select at least "3 asistentes"
Not necessary to fill the "asistentes" fields
OK, I know the problem
You need to use HTTPS for Stripe.js live integration, this page is server over HTTP, not HTTPS
this link should work now
no way.
I didn´t know this.
Thanks so mutch.
I´m gonna try right now
uoooooo.
it works.
Thanks.
you´re a master
Welcome 🙂