#stephy

1 messages · Page 1 of 1 (latest)

exotic compassBOT
gentle pivot
#

Hi there, how can I help?

stable garden
#

Actually I need to integrate ACh payment integration so how can I do this?

gentle pivot
stable garden
#

I have some doubt regarding this

#

My requirement is there is a main owner and his there is some vendors under the owner owner get amount from vendors and owner transfer the amount to each vendors accounts ..so my client need the ach payment integration....so I confused where I start? The owner have the account numbers of vendors...which method and api used for them

gentle pivot
#

So the owner will transfer funds to the vendors, so that the vendor scan pay out to their own bank accounts, is this the correct understanding?

stable garden
#

Vendors will enter their bank account and routing number so then owner transfer the amount to the vendors entered account

#

My client ask me to add bank account via ach and do ach debit or credit payment method

gentle pivot
#

I believe we talked about it yesterday and I've told you that you need to use Stripe connect to onboard the vendors as connected accounts, so that you can transfer funds from your accounts to those connected accounts. Have you got a chance to read through the doc I shared yesterday? https://stripe.com/docs/connect/accounts

Learn more about the different types of Stripe accounts you can use with Connect.

stable garden
#

Yes I read it I create a connected account using account:: create api also

#

But I got like this

gentle pivot
#

Copy and paste the account ID here

stable garden
#

Ok

#

acct_1N957NPO7lq4kgq7

gentle pivot
#

OK. I saw you have created an express account, and also set up its payout bank account

#

However this account is restricted because there're past_due requirements.

stable garden
#

That means what I use api to create this

#

$bankAccountToken = Token::create([
'bank_account' => [
'country' => 'US',
'currency' => 'usd',
'account_holder_name' => $request->input('account_holder_name'),
'account_holder_type' => 'individual',
'routing_number' => $request->input('routing_number'),
'account_number' => $request->input('account_number'),
],
]);

    // Create a Stripe account
    $account = Account::create([
        'type' => 'express',
        'country' => 'US',
        'capabilities' => [
            'card_payments' => ['requested' => true],
            'transfers' => ['requested' => true],
        ],
    ]);

    // Attach the bank account to the Stripe account
    $account->external_accounts->create([
        'external_account' => $bankAccountToken->id,
    ]);

    // Create a customer and link it to the Stripe account
    $customer = Customer::create([
        'email' => $request->input('email'),
        'source' => $bankAccountToken->id,
    ]);

    // Update the Stripe account with the customer ID
    $account->metadata->customer_id = $customer->id;
    $account->save();

    // Return the account ID and customer ID to the front-end
    return response()->json([
        'account_id' => $account->id,
        'customer_id' => $customer->id,
    ]);
}
#

I use above api to integrate this one?

gentle pivot
stable garden
#

You mean that I have create account link..ok after that how to made transfer amount from owner to vendors?

gentle pivot
#

After that you can use the Transfers API to transfer funds to the connected account (https://stripe.com/docs/api/transfers), once the funds are available, it's be paid out the bank account based on its payout schedule (https://stripe.com/docs/api/accounts/object#account_object-settings-payouts-schedule)

stable garden
#

I got a error not a valid url

gentle pivot
stable garden
#

req_hHCTKTSMbros5a

gentle pivot
#

As the error message mentioned, the URL that you specified in business_profile[url] is invalid.

exotic compassBOT
stable garden
#

Am in test mode so which url I will give?

#

Where I get the url

wild cloak
#

👋 Taking over this thread, catching up now

stable garden
#

Am in test mode so which url I will give?Where I get the url

wild cloak
#

You can set to your company URL or any proper URL in test mode for testing purpose

stable garden
#

So I can just give my site url is enough?

wild cloak
#

Yup!

stable garden
#

Why will provide the this URL actually?

wild cloak
#

If Stripe Connect is used, the URL represented the business website of the connected account (vendors in your case)

#

In live mode, it should be filled with real business URL of connected account

stable garden
#

I got a error and account createl link

#

req_HLDVCfi1VyJWcD

stable garden
wild cloak
#

Have you set it up?

#

I'd recommend following the instructions in error message

#

Ok..that means in my case I create a website for my business so I have to give that website url here?
Not your website URL, but the website URL of your vendors

stable garden
#

Is this enough?

wild cloak
#

If you don't have connected account/vendor's URL, you don't have to set business_profile.url in the account creation request

#

You'd need to add icon as explained in the error message

stable garden
#

I got error but that error not in logs actually

wild cloak
#

Which request or steps did you perform that resulted in this error?

stable garden
#

$bankAccountToken = Token::create([
'bank_account' => [
'country' => 'US',
'currency' => 'usd',
'account_holder_name' => $request->input('account_holder_name'),
'account_holder_type' => 'individual',
'routing_number' => $request->input('routing_number'),
'account_number' => $request->input('account_number'),
],
]);

    // Create a Stripe account
    $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/return',
        'type' => 'account_onboarding',
    ]);
    // Attach the bank account to the Stripe account
    $account->external_accounts->create([
        'external_account' => $bankAccountToken->id,
    ]);

    // Create a customer and link it to the Stripe account
    $customer = Customer::create([
        'email' => $request->input('email'),
        'source' => $bankAccountToken->id,
    ]);

    // Update the Stripe account with the customer ID
    $account->metadata->customer_id = $customer->id;
    $account->save();

    // Return the account ID and customer ID to the front-end
    return response()->json([
        'account_id' => $account->id,
        'customer_id' => $customer->id,
        'account_link_url' => $accountLink->url,
    ]);
#

Am used this one

#

It's agu. Restricted mode

wild cloak
#

There were a few requests to Stripe made in your code. Which exact line that threw the error?

#

You have to debug your own code to identify which line threw the error, so that I could help you further

stable garden
#

That error happnd when I attacj bank account to the stripe account

#

$account->external_accounts->create([
'external_account' => $bankAccountToken->id,
]);

wild cloak
#

If you use Express connected account, you don't have to create external accounts. The onboarding flow will create the external account for you.

stable garden
#

So I should remove that ?

stable garden
#

After removing that my error is gone but still the account is restricted mode

#

So this is why?

wild cloak
#

Have you completed the onboarding flow in the onboarding link created?

stable garden
#

$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/return',
'type' => 'account_onboarding',
]);

#

First I create account and the. Create link

#

After this one new account is created in my connect section..where am seeing that account is in restricted mode

wild cloak
#

The connected account won't be completed if you don't fill up the onboarding details in the onboarding link

stable garden
#

I can't understand .I done averything via api so where i fill up the details

#

Can you explain me in the basics of api

wild cloak
#

You have to go to https://connect.stripe.com/setup/e/acct_1N9M1HAcaaoPSRj7/xxx to complete the onboarding process

#

Completing the onboarding details can't be done via API

#

It has to be done via the onboarding URL

stable garden
#

But if am doing it via back end then how would this possible if a vendor have a form to fill up the details like account number and routing number then how would done all these things..

stable garden
wild cloak
#

Yes

#

Your system should direct the vendors to this URL to complete the onboarding process by filling up the details

#

But if am doing it via back end then how would this possible if a vendor have a form to fill up the details like account number and routing number then how would done all these things..
The onboarding URL will collect the bank details

#

Can you try to complete the onboarding process and check how the bank account collection is like in the onboarding page?

stable garden
#

Now the process completed

#

Now I want to transfer funds

#

So how can I send funds through api?

wild cloak
stable garden
#

I integrated this also get a error

#

req_usdutgZpTI8RMz

#

$transfer = Transfer::create([
'amount' => 1000, // Amount in cents (e.g., $10.00)
'currency' => 'usd',
'source_type' => 'bank_account',
'destination' => 'acct_1N9MpiPPKs5BjnsC', // Replace with the ID of the destination account
'description' => 'Transfer from John Doe',
]);

wild cloak
#

You need to have sufficient balance in your platform in your account for transfer as mentioned in the error: https://dashboard.stripe.com/test/logs/req_usdutgZpTI8RMz

You have insufficient funds in your Stripe account for this transfer. Your ACH balance is too low. You can use the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance).

#

It's likely that your platform has insufficient balance to transfer

stable garden
#

Then how can I add balance through my api?

wild cloak
stable garden
wild cloak
#

Where is the funding source of your balance? If it's from payments accepted from customer, then you can use the default card

stable garden
#

Not understand

wild cloak
#

From the error message, your platform (owner) account doesn't have enough funds to transfer to the connected account (vendors)

#

Do you get the funds from collecting the payments from customer or by topping up I suggested earlier?

#

By default, you shouldn't need to set source_type

#

The primary problem here is how do you make sure the platform (owner) to have sufficient funds for transfers

stable garden
#

I give my source_type as bank_account then this error occur,,,after udpating source_type to card it's work

wild cloak
#

The default of source_type is card. You probably don't need to set it unless necessary

stable garden
#

In ach payment can we use card?

wild cloak
#

The source_type refers to where the source balance is from irregardless how the connected account is paid out