#jairo_api
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/1471168075167567924
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
I'm using the PHP SDK to make API calls, and the same code either works fine or throws the indicated error, depending on the context in which my application is running.
I’m debugging at a low level to inspect the call’s options, parameters, and headers, and I can’t spot any differences. However, there must be something, since sometimes it works and other times it throws the “account invalid” error.
Can you share the request id's
Perhaps on your side you can see what differences there are between the calls and identify what’s wrong with the ones that fail?
Sorry, but the response headers of the failing calls do not include a request-id.
The HTTP error code is 403
What do you mean by the same code either works fine or throws the indicated error, depending on the context in which my application is running
What does context refer to
What is changing between the requests
This only happens in my application when running in an asynchronous/background context, but the same flow executed from an HTTP context works without any issues. There must be something in my application that doesn’t behave correctly in that context. I assume I should be able to see it in the API call details, but I’ve compared them and so far haven’t found any differences.
Do you have logic in your application to change the api key ever?
I'm debugging and both cases are using the same Api Key
But do you have logic in your application to change the api key ever?
This matters if you have async flows
No, Api Key is always the same for all flows
here you can see the request headers
The Api Key used for this call is correct, and it’s the same one used in the calls that work correctly.
Here, the request headers of the same call, but from HTTP context:
It's trying to run the request on a connect account with a blank id
You shouldn't include that header at all if running on the platform account
Stripe-Account is also empty here, but is working
Is there an extra space after the ":" there too?
Yes, it looks identical, as you can see.
This is the request-id of the call that works well: req_9Vq8rxZo2YSVIP
Can you share the code snippet for the request?
my code is very simple:
$stripe = new Stripe\StripeClient(['api_key' => 'xxx', 'stripe_version' => '2020-08-27']);
$session = $stripe->checkout->sessions->retrieve($sessionId);
Can you remove the api key. This is a public server
I know it's a test key
But it could still be used to fill your account with garbage in your test env
Also, when did this start happening? Has this always been an issue in your integration or did this recently crop up? Or is this a newer integration path you're building?
Sorry, I know, I forgot to remove it from the copy-paste
It is a new path we are building
FYI i'm taking over for codename_duchess, we're currently looking into this with the product team who owns this
We've found the problem! The root cause is not in your side, so you don't need to worry!
Thank you for your support 🙏
What was the root cause?