#jairo_api

1 messages · Page 1 of 1 (latest)

crisp mothBOT
#

đź‘‹ 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.

sick rover
#

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.

light goblet
#

Can you share the request id's

sick rover
#

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

light goblet
#

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

sick rover
#

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.

light goblet
#

Do you have logic in your application to change the api key ever?

sick rover
#

I'm debugging and both cases are using the same Api Key

light goblet
#

But do you have logic in your application to change the api key ever?

#

This matters if you have async flows

sick rover
#

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.

light goblet
#

Oh I see the issue

#

"Stripe-Account: "

sick rover
#

Here, the request headers of the same call, but from HTTP context:

light goblet
#

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

sick rover
#

Stripe-Account is also empty here, but is working

light goblet
#

Is there an extra space after the ":" there too?

sick rover
#

Yes, it looks identical, as you can see.

#

This is the request-id of the call that works well: req_9Vq8rxZo2YSVIP

light goblet
#

Can you share the code snippet for the request?

sick rover
#

my code is very simple:

$stripe = new Stripe\StripeClient(['api_key' => 'xxx', 'stripe_version' => '2020-08-27']);
$session = $stripe->checkout->sessions->retrieve($sessionId);

light goblet
#

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?

sick rover
#

Sorry, I know, I forgot to remove it from the copy-paste

#

It is a new path we are building

crisp mothBOT
spiral apex
#

FYI i'm taking over for codename_duchess, we're currently looking into this with the product team who owns this

sick rover
#

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 🙏

light goblet
#

What was the root cause?