#ilies_api

1 messages ยท Page 1 of 1 (latest)

bronze orbitBOT
#

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

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

stark linden
#

I would suspect that based on the error you haven't completed the 'questionnaire' in the Dashboard to enable Connect on whatever account's keys you're using

#

This kind of proves that theory, because there should be a log

#

So you're either on the wrong account, or using a Sandbox

#

That doesn't show me anything I'm afraid. I suspect you're looking at a different account/Sandbox as stated

#

Hence why you can't find the request log

#

If you make the API request again, check the response headers. There should be a req_xxx ID in there

sonic path
#

My request gets a "500 Internal Server Error".
And to be honest i'm not even sure that this is the right request.

stark linden
#

That's your server that is returning a 500 error โ€“ not us

sonic path
#

Sorry that doesn't help me much, i still get the same error message

stark linden
#

That should print out a req_xxx in your server logs

sonic path
#

There is no issue with the request you're giving me : req_EfQLGjCeoSzJ55

It's the one i'm trying to do that get the error

stark linden
#

What's your account ID? acct_xxx?

sonic path
#

acct_1EahBMCduUEOhAfj

stark linden
#

OK so that error message ('You can only create new accounts if you've signed up for Connect,
which you can learn how to do at https://stripe.com/docs/connect'') is thrown by an internal code. I'm looking at all request logs for the past 7 days that have thrown that error code and none of the requests were made by keys from acct_1EahBMCduUEOhAfj

#

So that implies my original theory is probably accurate โ€“ you're looking at the Dashboard for a different account, not acct_1EahBMCduUEOhAfj or using different API keys

bronze orbitBOT
fallow pendant
#

hi! I'm taking over this thread. let me know if you have other questions.

sonic path
#

But we only have one account don't we ?

#

Hi

#

The account is the right one since when i did the request to create a customer it worked

#

its when i'm trying to create a Connect account that the error pops up

fallow pendant
#

Can you log the full error message you get when the API fails? I'm looking for the Request ID it in (req_xxx)

sonic path
#

Here is the request when creating a customers

#

Here is the result when creating an account

fallow pendant
#

How are you trying to create the account? With the API? If so, can you share the full response from Stripe?

sonic path
#

I'm using the PHP SDK

#
    public function createExpressAccount(Company $company): ?Account
    {
        $account = $this->stripe->accounts->create([
            'type' => 'express',
            'capabilities' => [
                'card_payments' => ['requested' => true],
                'transfers' => ['requested' => true],
            ],
            'business_type' => 'company',
        ]);

        dd($account);

        $company->setStripeAccountId($account->id);

        return $account;
    }
fallow pendant
#

then can you share the full error message returned by Stripe?

sonic path
#

I only have the error 500

fallow pendant
#

can you wrap your code in a try ... catch and log the error?

sonic path
#
        try {
            $account = $this->stripe->accounts->create([
                'type' => 'express',
                'capabilities' => [
                    'card_payments' => ['requested' => true],
                    'transfers' => ['requested' => true],
                ],
                'business_type' => 'company',
            ]);
        } catch (ApiErrorException $e) {
            throw new RuntimeException('Error creating Stripe account: ' . $e->getMessage());
        }
#

Unless there is a specific Stripe error handler i'm still getting the same message

fallow pendant
#

now you need to log that errror message somewhere.

#

hum... wait.

#

and if you try to log what's inside $e directly?

sonic path
#
Error creating Stripe account: Error sending request to Stripe: (Status 400) (Request req_HyHdMYf4xdJLl2) You can only create new accounts if you've signed up for Connect, which you can learn how to do at https://stripe.com/docs/connect.
#

My apologies here is the request id

fallow pendant
#

Perfect! looking at the request ID.

sonic path
#

Pardon my capabilities i'm still a trainee

fallow pendant
#

Well, that request was made by account acct_1PAqM8RvQTUxiXPg, which is different from the account ID you shared earlier

#

and that account doesn't have connect enabled

#

so make sure to double check the API keys you are using to make your requests.

sonic path
#

Thank you i think i figured where the problem is

#

Alright my apologies it was a previous trainee that used his own API key hence we didn't see anything

#

Thank you for you help have a nice day !