#Sarvesh-connect

1 messages ยท Page 1 of 1 (latest)

near pumice
#

hi! sounds like you didn't finish onboarding the account

limber cloak
#

$account = $stripe->accounts->create([
'country' => 'US',
'type' => 'express',
'business_type' => 'company',
]);

    if(!empty($account) && isset($account->id)) {
        $accountLinks = $stripe->accountLinks->create([
            'account' => $account->id,
            'refresh_url' => config('services.stripe.platformBaseUrl').''.config('services.stripe.StripeRefreshUrl'),
            'return_url' => config('services.stripe.platformBaseUrl').''.config('services.stripe.StripeReturnUrl'),
            'type' => 'account_onboarding',
        ]);
        Log::info(json_encode($accountLinks));
        if(!empty($accountLinks) && isset($accountLinks->url)) {
            return redirect($accountLinks->url);
        }
    }
near pumice
#

yep that is code

limber cloak
near pumice
near pumice
# limber cloak

cool, so it's telling you that you need to edit the information in red. Which specific part are you having trouble with? I immediately see for example you used "line1" as part of the address, when it should be "address_full_match" per the docs for testing

limber cloak
#

address_full_match means ? I need to put it in address fields?

#

INFORMATION NEEDED - DUE NOW
Business address
Attempted
Owner's address

near pumice
#

yes. When it asks for for an address you fill in the form entering something like address_full_match , London, UK

#

(or any city/country that makes sense for the account in question)

limber cloak
#

ok, i will try with address_full_match

#

I have one question, now I am connecting this account under my strip account which will be new strip account so connected account member can do own login and check the transferred payments or he must already have strip account that only i can connect under my account?

near pumice
#

Stripe, not Strip

#

so connected account member can do own login
that depends on the type of account

limber cloak
#

ok fine

#

if user already have stripe account then can we take stripe account id from him and skip intermediate step of filling business/personal info and directly connect his/her account using account id via api?

#

address_full_match after adding this now account shows status "complete" in green and payment transfer is also done

#

thanks

#

if user already have stripe account then can we take stripe account id from him and skip intermediate step of filling business/personal info and directly connect his/her account using account id via api?

near pumice
limber cloak
#

i see, ok

#

now I created $6 payment intent and transferred $1 to connected account via api which works fine.
But if I go to Payments menu and open recent entry, then I can see

Amount
$6.00
Fee
$0.47
Net
$5.53

#

But as I transfered $1 from it to connected account so Net should reduced by $1 also?

#

$4.53?

#

or these are 2 separate things?

#

I can see $1 balance in connected account

crimson mantle
#

Hi! I'm taking over this thread.

limber cloak
#

Hi soma

crimson mantle
#

If you first did a PaymentIntent, and then later made a transfer, then those are two different things yes.

limber cloak
#

ok, fine

#

for connecting accounts, is it required that the person should first have his own stripe account ?

crimson mantle
#

I'm not sure I understand. Can you clarify your question?

limber cloak
#

means as a web admin I will have stripe account and there will be few event hosts will register on my website to post free/paid events. So those hosts I want to connect under my stripe account so that we can split the payments. So if any hosts do not have stripe account then how to handle it? may be just taking bank details etc?

crimson mantle
#

If you want to send money to users with Stripe, then you have to use Connect and they need a Stripe account yes.

limber cloak
#

ok, so while connecting via account links (onboarding) their stripe account will get auto created if they do not have and they will get stripe logins to check their account?

crimson mantle
#

Yes you should create a new account with account links, and then for Standard and Express accounts then can login in their Stripe dashboard.

limber cloak
#

ok, fine

#

$account = $stripe->accounts->create([
'country' => 'US',
'type' => 'express',
'business_type' => 'company',

    ]);
#

Is this sufficient inputs to generate connect account link or need any changes?

#

what if I only keep 'type' => 'express' only?

crimson mantle
#

Using just type: "express" should be enough for the API call to work. But then you can add more parameters depending on your needs. I recommend doing some tests in test mode to see how it works.
And you can learn more about this here: https://stripe.com/docs/connect/express-accounts

limber cloak
#

ok

#

how i can login to connected account from test mode to check other connected strip account?

#

login/password of connected account where I will get

crimson mantle
limber cloak
#

ok, checking

limber cloak
#

login to account link works

#

when I create account Link and host is filling his information for onboarding and if has not completed it on same time / close window / internet gone etc.
how he can start it again ?

#

the same link he can click and continue again from start?

crimson mantle
#

You can create a new account link for them to finish onboarding.

limber cloak
#

ok, the old link will not work again?

crimson mantle
#

No you need a new link

limber cloak
#

ok

#

In the Stripe UI - under Payments menu I think can see all transactions but If I go to Balances menu then it shows $0.00 . So the amount received from the payments is not considered in balance?

boreal tusk
#

It's likely those payments may not have cleared in your balance yet

#

Can you share an example?

limber cloak
#

Yes, this was the recent test mode payment of today
payment id: pi_3LfKFXALTlZ8nxc30APpaqhj

#

$6.00USD
Succeeded

#

This payment is complete

boreal tusk
limber cloak
#

ok, I will try this. currently I am using this test card data
$method = PaymentMethod::create([
'type' => 'card',
'card' => [
'number' => '4242424242424242',
'exp_month' => 12,
'exp_year' => 34,
'cvc' => '314',
],
]);

which needs to replace with card number "4000000000000077" ?

#

how much time will take of existing payments to reflect in to balance?

boreal tusk
#

Why do you need to create a PM? Just use the existing tokens from that page: pm_card_bypassPending

boreal tusk
limber cloak
# boreal tusk Why do you need to create a PM? Just use the existing tokens from that page: `pm...

Stripe::setApiKey(config('services.stripe.stripeSecret'));
$method = PaymentMethod::create([
'type' => 'card',
'card' => [
'number' => '4242424242424242',
'exp_month' => 12,
'exp_year' => 34,
'cvc' => '314',
],
]);

    $paymentIntent = PaymentIntent::create([
        'payment_method_types' => ['card'],
        'payment_method' => $method->id,
        'amount' => 600,
        'currency' => 'usd',
        'transfer_group' => 'testorder12',
        'confirm' => true,
    ]);

    if(!empty($paymentIntent) && isset($paymentIntent->charges->data[0]->id)){
        $transfer = Transfer::create([
            'amount' => 100,
            'currency' => 'usd',
            'destination' => 'acct_1LfK9OPETSKQ370i',
            "source_transaction" => $paymentIntent->charges->data[0]->id,
            'transfer_group' => 'testorder12',
        ]);
    }
#

where to use pm_card_bypassPending ?

boreal tusk
#

In the payment_method param when creating the Payment Intent

limber cloak
#

ok, trying it

#

so then no need to change the card number to 4000000000000077?

solid shard
#

Hey! Taking over for my colleague. Let me catch up.

#

Could you please resume/give more context to your last follow-up question?

limber cloak
#

no, its resolved now i can see balance reflected when i use payment_method = pm_card_bypassPending

solid shard
#

Great, don't hesitate to come back if you have any follow-up questions ๐Ÿ™‚

limber cloak
#

yes,

#

one question

#

If connected account complete the onboarding process but something not filled correctly and account status gets Restricted / Restricting soon etc then what to do?
Any api to call again to update his info or he needs to go through new account link again for onboarding?

near pumice
#

you send them to the Express dashboard and they can provide any information needed there

limber cloak
#

ok

#

ok, Just fixed errors related to address showing on the connected (Restricted) account dashboard by and now it is active (y)

#

the express dashabord link which is created for 1 connected account will always be active or it keeps changing and need to generate and send new link everytime ?

#

if we save the connected account login link in database and shown to profile of our application to goto Stripe express dashboard for user then will it work?

#

?

#

how to refund payment to user back if he cancelled the event registration?

solid shard
#

Hi sorry for the late reply, it's been busy on discord so far

limber cloak
#

so from connected account refund should be done or from main stripe account?

solid shard
#

it depends on the charge type ?

#

What type of charge are you using ?

limber cloak
solid shard
limber cloak
#

Stripe::setApiKey(config('services.stripe.stripeSecret'));
$method = PaymentMethod::create([
'type' => 'card',
'card' => [
'number' => '4242424242424242',
'exp_month' => 12,
'exp_year' => 34,
'cvc' => '314',
],
]);

    $paymentIntent = PaymentIntent::create([
        'payment_method_types' => ['card'],
        'payment_method' => $method->id,
        'amount' => 600,
        'currency' => 'usd',
        'transfer_group' => 'testorder12',
        'confirm' => true,
    ]);

    if(!empty($paymentIntent) && isset($paymentIntent->charges->data[0]->id)){
        $transfer = Transfer::create([
            'amount' => 100,
            'currency' => 'usd',
            'destination' => 'acct_1LfK9OPETSKQ370i',
            "source_transaction" => $paymentIntent->charges->data[0]->id,
            'transfer_group' => 'testorder12',
        ]);
    }
solid shard
#

if you are using seperate charges and transfer, so only the platform account can do the refund for customers

limber cloak
#

ok which api to use for refund?

solid shard
limber cloak
#

ok for user side, to pay we need to integrate stripe iframe to accept the payments or redirect to stripe payment page?
can you share the links for it?

rain hill
#

Hello ๐Ÿ‘‹
Taking over as os4m37 needs to step away soon, give me a few to catch up

limber cloak
#

for refund of payments
e.g. if there is an paid event with $10 then web platform owner will get $1, event hosts will get transfer of $8 and $1 will get deducted as a Stripe processing fee so = $10
now if user cancelled the event, then from connected hosts accounts we need to refund $9 and from web platform account $1
so how this can be achieved from api?

rain hill
limber cloak
#

ok i will check this in details
but I just want to know quickly that refund can be possible only from main account or connected account also it is possible to refund?

rain hill
#

If you're using Separate Charges and Transfers, the platform account will have to be the one refunding.
As the charge was created by the platform

limber cloak
#

i see, ok and if I want to refund from the connected account as platform share will be very less and major part will go to connected account so then what needs to do? any other api to use for it?

rain hill
limber cloak
#

ok got it but in that case also
\Stripe\Stripe::setApiKey('sk_test_z');
should be of platform owner stripe account only right?

rain hill
#

yes