#rao-burhan_error

1 messages ยท Page 1 of 1 (latest)

terse smeltBOT
#

๐Ÿ‘‹ 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/1350060547814723586

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

rotund imp
#

๐Ÿ‘‹ happy to help

#

would you mind sharing the request ID that's failing?

novel roost
#

acct_1Qza1LR0ZWnFsQGK

rotund imp
#

that's an account ID

novel roost
#

@rotund imp The request itself is not failing but on the frontend i am getting this error while creating the session
he specified Checkout Session could not be found. This error is usually caused by using the wrong API key or visiting an expired Checkout Session. Please make sure the Session is not expired and that the API keys used to initialize Stripe.js and create the Checkout Session are test mode keys from the same account.

the session id and publishable key is returned by the backend
return {
sessionId: session.id,
publishable_key,
}

And it is also working fine whne i am not using
{ stripeAccount: accountId },
but it is not creating my sessions when i am using

 { stripeAccount: accountId },
rotund imp
novel roost
#

We are not using this implementation we redirect users to the stripe hosted checkout page after creating the session , the session is creting correctly in both cases from the backend , but in the case of stripeAccount it is giving the above error in the stripe hosted checkout page.

rotund imp
#

how are you redirecting?

#

you should just return session.url

#

and redirect to that URL

#

you don't need the ID or the publishable key in that case

novel roost
#

we are using session id to redirect to the stripe checkout page
useEffect(() => {
if (success && isStripeConnected && stripe) {
stripe.redirectToCheckout({ sessionId: data.sessionId });
}
}, [success, stripe, isStripeConnected]);

rotund imp
#

redirectToCheckout this is an old and deprecated function that you should not use

#

or you can return the session.url to the frontend and do the redirection there

#

with window.location.href or window.location.replace https://www.w3schools.com/howto/howto_js_redirect_webpage.asp