#stephy

1 messages · Page 1 of 1 (latest)

half kernelBOT
eager blaze
#

Hi, how can we help?

unborn bridge
#

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?

eager blaze
#

What you just described is mostly correct. You can think of 2 separated process

  1. Create and onboard an account
  2. 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

unborn bridge
#

1.Create and onboard an account , to do this via account api right?

eager blaze
#

Yep

unborn bridge
#

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

eager blaze
#

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.
unborn bridge
#

how would do this webhooks?

eager blaze
#

Webhook is async, but we will send account.updated when anything changes on any Connected Account

unborn bridge
eager blaze
#

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?

unborn bridge
#

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

eager blaze
#

Webhook requries some effort. Let's put it aside. Anything prevent you from simply call a Retrieve Account Api upon your return URL endpoint?

unborn bridge
#

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

eager blaze
#

Yes, so when it come to a function you you take that account id

unborn bridge
#

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?

eager blaze
#

Check its details_submitted parameter

#

If it's true, continue to save to your database

#

if not, abort

unborn bridge
#

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?

eager blaze
#

When openned the Link I don't think back button is pushable

unborn bridge
#

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

#

but after go the link if any one click browser back it will agin back to my connect button page

eager blaze
#

Yeah in that case you can't catch it then

#

There will be a new Account created but never been submited anything

unborn bridge
#

yes ..any other solutions to catch that??

eager blaze
#

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

unborn bridge
#

oh okay..so is neccessary to do webhooks ?

eager blaze
#

It depends on what do you want to do exactly. If you want to catch all these case, no webhook can't help you because no event will be sent

#

I am trying to say that you can just ... ignore those cases and focus on processing the onboarded account

unborn bridge
#

ok

#

so if i need to check the payment status then is webhook need for that?