Hello,
Did you find out how to do it ?
I have the same issue :/
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
My multi tenant application needs the ability to allow existing users to associate a Stripe account with their individual account in my login.
So the use case is
1: User will already have a local account in my Laravel app 2: The user from 1, will click the Stripe connect link 3: My app will associate the pre-existing laravel account, with the newly created Stripe Account - saving all the details in the DB.
I am using the following to obtain a user's Stripe account details via Stripe Connect:-
SocialiteProviders/Stripe https://github.com/SocialiteProviders/Stripe
Stripe Connect https://stripe.com/docs/connect/standalone-accounts (slight mod made to get the response I required).
This is what I have setup in the controller
public function onboard()
{
return Socialite::driver('stripe')->redirect();
}
public function onboardResponse(Request $request)
{
//dd(Socialite::driver('stripe')->user()); // no use as I also need the user's publishable key and other fields stripe sends.
dd(Socialite::driver('stripe')->FullResponse());
}
I receive back from Stripe Connect the following, which I need to save against the user's specific account.
"access_token" => "sk_test_8jYXXXXXXXXXXX"
"livemode" => false
"refresh_token" => "rt_7fkLQ5hXkuXXXXXXXXXXXXXXXXXXXXX"
"token_type" => "bearer"
"stripe_publishable_key" => "pk_test_MFMIXXXXXXXXXXXX"
"stripe_user_id" => "acct_15NqXXXXXXXXXXXXXXXX"
"scope" => "read_write"
Assuming a user is logged in, how am I supposed to save the returned info to that users account?
Stripe does not support dynamic URL's for sending the response back.
The only additional parameter that the Stripe Connect will take (and pass back on response) is 'state' - and that is already used by Socialite internally it seems.
I see from the Socialite code, that a random 'state' string is generated by the package and sent out and is inspected upon Stripe's response. Under normal circumstances, this 'state' value is hidden away.
Do I need to save this 'state' value against the user in the DB before the initial request gets send out to STripe by Socialite,
Then on the response, inspect the state somehow from Socilite, and pair of the response with the state value I saved in the DB earlier?
Once the states are confirmed to match, I can save the response values in the DB.
In essence, I need to make sure the user account received back from Stripe is saved against the correct user record in my database.
Please or to participate in this conversation.