#_powerred
1 messages · Page 1 of 1 (latest)
Assuming your request was successful, the response will include an id field: https://stripe.com/docs/api/accounts/object#account_object-id
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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',
]);
What is getClientId()?
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)
You're not assinging the response to your create call to a variable:
$account = $stripe->accounts->create([
])
$id = $account->id
^^