#gumehara-connect-oauth
1 messages · Page 1 of 1 (latest)
Hello, how can I help?
@hybrid pilot can you put the rest of your details in this thread?
I am trying to implement connect on our platform
the tutorial says to create a new client
but our clients already have a stripe account
Sorry
No worries, we just try to keep things in threads once we make them
So
We have an OAuth flow for connecting existing accounts https://stripe.com/docs/connect/oauth-reference
I know
and i've read it
Im just wondering
on how does it work exactly
Isn't the account_id passed in the return url
how am i supposed to get the account id for an existing client
check this out
I generate an id
then i login with a different account in the oauth flow
I think I may need a bit more clarification. Are you on this step at that point? https://stripe.com/docs/connect/oauth-reference#post-token
Ok
let me send screnshots
what i do step by step
First Step
a user clicks a button on the frontend
Connect Stripe
Then i call this method
public function connectAccount(int $companyId): string
{
$stripeLink = $this->stripeClient->accountLinks->create(
[
'account' => '{platform_id}',
'refresh_url' => '{refresh_url}',
'return_url' => '{returl_url}',
'type' => 'account_onboarding',
]
);
return $stripeLink->url;
}
Is that the correct way to call it
Because when i put platform_id in account
it says account does not exist
The account ID there is supposed to be the connected account ID, not the platform account ID
How do i get the account id
Though I don't think you can do an account link for an existing account
of the person i wish to connect
Well then how do i connect an existing account to my platform
I think the intended flow is to do the OAuth connection and that step that I linked to is where you get the account ID
I cannot even start the oauth flow
without an account id
the code returns the url for me to redirect the customer to
To be clear, the accountLinks thing is not the OAuth flow. The OAuth flow as far as I can see does not need the existing account ID to get started