#rao-burhan_error
1 messages ยท Page 1 of 1 (latest)
๐ 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.
acct_1Qza1LR0ZWnFsQGK
that's an account ID
a request ID is req_xxx https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
@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 },
are you using https://docs.stripe.com/checkout/custom/quickstart ?
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.
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
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]);
redirectToCheckout this is an old and deprecated function that you should not use
you can either directly redirect from the backend as described here https://docs.stripe.com/checkout/quickstart
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