#stephy
1 messages · Page 1 of 1 (latest)
Hi, how can we help?
i set up connected account through my site using our backend code .. my purpose is to trasfer the amount to these conneted accounts...so that why i set up this one ..for that first i create account:create api to create an account then next i use accountLink api where i get a url and and i give redirect to onborading page to completed this one also store the account id in my database , when i tranfer the amount i took the corresponding account id from database and transfer the amount,...is this coreect?
if anything that i miss out?
what happend if i redirect to the url but i click browser back up ? i think account is created but the proccess incomplete so the account shows restricted mode right?? how can mange all these issues?
What you just described is mostly correct. You can think of 2 separated process
- Create and onboard an account
- Transfer an amount to the fully onboarded account
If there is some issue in step 1, then you can create another Account Link and give it to your customer again to complete it
1.Create and onboard an account , to do this via account api right?
Yep
yes that i alredy one i create a account<like $account = Account::create([
'type' => 'express',
'country' => 'US',
'capabilities' => [
'card_payments' => ['requested' => true],
'transfers' => ['requested' => true],
],
'business_type' => 'individual',
'business_profile' => ['url' => 'https://phplaravel-813399-3371113.cloudwaysapps.com/'],
]);
$accountLink = AccountLink::create([
'account' => $account->id,
'refresh_url' => 'https://phplaravel-813399-3371113.cloudwaysapps.com/refresh',
'return_url' => 'https://phplaravel-813399-3371113.cloudwaysapps.com/connect_account_success?account_id=' . $account->id,
'type' => 'account_onboarding',
]);
this way
2.Transfer an amount to the fully onboarded account,, how would identify this ..is the account is full =y onboraded if the account is not fully onboarded can we delate that account?
after above i just use $accountLink->url to complete the on boarding
Stripe issues a redirect to this URL when the user completes the Connect Onboarding flow. This doesn’t mean that all information has been collected or that there are no outstanding requirements on the account. This only means the flow was entered and exited properly.
No state is passed through this URL. After a user is redirected to your return_url, check the state of the details_submitted parameter on their account by doing either of the following:
- Listen to account.updated events with a Connect webhook.
- Retrieve the account with the API.
how would do this webhooks?
Webhook is async, but we will send account.updated when anything changes on any Connected Account
https://stripe.com/docs/webhooks for general webhook guide and https://stripe.com/docs/connect/webhooks for how to adapt to Connect webhooks
the think i understand when i read
1.https://dashboard.stripe.com/test/webhooks/create using this create a webhooks into the stripe account and you got some code in right side copy that code and paste the back end right?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yeah that's fair amount of efforts too, not just copying and pasting
How about using the 2nd approach? by calling Retrieve Account Api upon your return_url?
that i dont know ..now i craete a webhook in my stripe account and after that how will check and use my code is little confusing
Webhook requries some effort. Let's put it aside. Anything prevent you from simply call a Retrieve Account Api upon your return URL endpoint?
no,. i call a return_url and pass some parameter like account_id through that and when it comes to a function i take that account id and update the databse the corresponding account id is now complted
Yes, so when it come to a function you you take that account id
before update the database, call this Retrieve Account API https://stripe.com/docs/api/accounts/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
on i retrive the account details then what i do ?
now i retrive the account info using /api/accounts/retrieve
after that what is next step i need to do?
Check its details_submitted parameter
If it's true, continue to save to your database
if not, abort
ok ..so some more doubt also if they redirect to link but they click browser back button then also we can go the return url?
When openned the Link I don't think back button is pushable
actullay i use return redirect()->away($accountLink->url); to go to the url so if i click browser back arrow which will back to my site page
https://connect.stripe.com/setup/e/acct_xxx when i click a connect button my website page redirec t to above link where i can fill the details
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
but after go the link if any one click browser back it will agin back to my connect button page
Yeah in that case you can't catch it then
There will be a new Account created but never been submited anything
yes ..any other solutions to catch that??
No. I think you can simply ignore it.
It's same if someone write a bot to spam your button and never finish the flow
oh okay..so is neccessary to do webhooks ?