#bks_error

1 messages ยท Page 1 of 1 (latest)

kindred coralBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1376911237710876846

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

tulip topaz
#

Hey there, how exactly are you creating and redirecting to checkout sessions?

charred crater
#

It is using the same code that Stripe provides for the self hosted checkout.

#

let me find the link for tit

tulip topaz
#

It looks like you're returning the client secret from your back end

#

So i infer that you're using redirectToCheckout() in your client app

#

This is a deprecated pattern, and you can encounter the error you see for example with mismatched Connect configurations.

#

Instead of using the client secret, you can return the session url and just redirect to that without using Stripe.js

charred crater
#

No I am using the checkout.html on the self hosted checkout like stripe has in their documentation

tulip topaz
#

But if you can share an example sesison ID and your client side initialization/redirect code i can also try to help debug that

charred crater
#

It uses checkout.js to enable the checkout

#

here is the js file that checkout uses.

tulip topaz
#

That code appears to be unrelated, or possible from a status/success page.

#

It's also possible you're referring to some outdated samples. The docs I see describe and show using the url as i mentioned. If you still see redirectToCheckout in a doc please share a link to that so i can see about getting it updated.

charred crater
#

Sure.

tulip topaz
#

Oh, this is embedded. I see. There's no redirect in that case. I missed that line in your snippet before.

#

OK, can you share an example session ID and how you're initializing Stripe.js and the embedded checkout in your client code?

charred crater
#

Sorry I am new to this so not sure how to generate the example session id. Are there any instruction that I can follow to genrate that?

tulip topaz
#

That's the result of your call to session = stripe.checkout.Session.create( ...)

#

That's creating a session, which would have an ID

charred crater
#

It seems like it is not even hitting the stripe endpoint as I can't find any API requests from today. So the issue might be that it is failing before even hitting the endpoint.

#

and I do not have erros being logged in the error log either

#

so it is making it difficult for me to see where the issue might be.

#

but when I make the call using curl, it renders the HTML like I would expect it to be.

#

The issue seems to be with the call on checkout session failiing with 500 error code

kindred coralBOT
tulip topaz
#

Yes, that tells me your server (your backend where the checkout sesison creation happens) is crashing when you try to use it

#

You should add some diagnostic logging to that and determine when/where it's failing