#_powerred

1 messages · Page 1 of 1 (latest)

golden craterBOT
raven palm
dense charm
#

yes but this code return a empty string for id:

#

$stripe = new StripeClient('sk_test_51K2XmjB9Z93D24ZOVJq6jBBoi8GCe1EMw40RQD5NJmfGl8ysQ0q74njxUX1Gqn9srW1HGxPvihbTOGSFd9d5wH42004uz2C3QJ');

    try {
        $stripe->accounts->create([
            'country' => 'FR',
            'email' => 'pwet@email.fr', //$user->getEmail(),
            'type' => 'express',
            'capabilities' => [
                'card_payments' => ['requested' => true],
                'transfers' => ['requested' => true],
            ],
            'business_type' => 'individual',
            'business_profile' => ['product_description' => 'Louer un jardin ' . $user->getUsername()]
        ]);

        $id = $stripe->getClientId();
    } catch (ApiErrorException $e) {
        dd($e);
    }


    $stripe->accountLinks->create([
        'account' => $id,
        'refresh_url' => 'https://example.com/reauth',
        'return_url' => 'https://example.com/return',
        'type' => 'account_onboarding',
    ]);
raven palm
#

What is getClientId()?

dense charm
#

I was thinking that is the stripe account id but no ^^'

#

the prooblem is that the account is create but I don't find the api return on the stripe object (like a method or something else)

raven palm
#

You're not assinging the response to your create call to a variable:

$account = $stripe->accounts->create([
])

$id = $account->id
dense charm
#

^^