#enriquejf_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/1433742123101978675
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you share the request ID (req_xxx) for the failed call? https://support.stripe.com/questions/finding-the-id-for-an-api-request
The payment was successful in Stripe
:No such checkout.session: cs_live_a1dG6OohSJlB57bJSxdoWwP91IT8PJ6Xl8a59ubK0D7DrpcwkhUBeG7Iiy; code: resource_missing; request-id: req_pDbih0MgJtBkec
this?
Are you sure you're using the correct secret key in your request?
I can see the checkout session was created in this request: https://dashboard.stripe.com/acct_1PcnwMDx7LcOdCbe/logs/req_aKgz9Yk0p1Fdaw, which is on account acct_1PcnwMDx7LcOdCbe, but it looks like your failing request is authenticating as account acct_1PcnlbCvxUUwNn8g
those accounts are dynamic?
What do you mean by dynamic?
No problem, happy to help
sorry, those accounts are created with a new session with apikey and secret, isn't it?
Each account has it's own keys/secrets, yes
We're on Java, when we get the response from Stripe after payment, we're calling
Session.retrieve(sessionId);
how Stripe knows the account?
You would have previously initialized the code with your secret key - this is what ties your requests to a specific account
And stripe stores it internally in the web session?
It's stored locally on your side and included with requests sent to Stripe
hmmm we don't store anything ad-hoc, we only take the session id for checking, perhaps into your jar file is the response...
You would need to pass the api key to Stripe.apiKey in order for it to be able to make any requests - this is all you need to do. How it's stored/transmitted is done in the background
ok, but somehow stripe stores this account in the background associated to a token to not ask for creds again. As we had networking issues, we lost the web session, so that connection was lost and on the background Stripe obtained a new account with the same api key, could be?
Networking issues wouldn't affect it, the API key is set in your app locally, and then sent to us with each request. So I'd look into how your setting it, if you perhaps have multiple instances with different keys, or if you're caching it in some way in your integration
ok, the api key is sent with each request, but the account should be the same for all the payment process, true?
๐ Hi there, I'm taking over for my colleague who had to step away
ok, the api key is sent with each request, but the account should be the same for all the payment process, true?
In general, yes. You set the API key when initialising the SDK, and that corresponds to one Stripe account.
But it is possible to override the API key per request. But this is something you would have to do explicitly
but if we override the API it will create another stripe account and we couldn't retrieve the session, true?
Right. An API key only lets you access one Stripe account.
So if you create a Checkout Session using an API key for Account ABC, you cannot later retrieve that Checkout Session using an API key that belongs to Account XYZ, for example.
Yes.
- You created the checkout session yesterday using the API key ending in
KoeDLD, which belongs toacct_1PcnwMDx7LcOdCbe - You attempted to retrieve the Checkout Session using the API key ending in
EWuITO, which belongs toacct_1PcnlbCvxUUwNn8g