#vtor_connect-externalaccount

1 messages · Page 1 of 1 (latest)

obtuse masonBOT
winged scaffoldBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

obtuse masonBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1254820624279404646

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

vital turtle
#

Hello

#

You are using Embedded Onboarding components here?

somber spade
#

hey

#

yes

vital turtle
#

Gotcha and what type of Connected Accounts are you working with here?

somber spade
#

import { ConnectComponentsProvider, ConnectAccountOnboarding } from "@stripe/react-connect-js";

#

im creating custom accs

#

// Create a new Stripe account for the user const account = await stripe.accounts.create({ type: 'custom', country: 'BR', email: data.email, capabilities: { card_payments: { requested: true }, transfers: { requested: true } }, business_type: 'individual', });

vital turtle
somber spade
#

hmm im not sure i understood

#

i create acc > create session > would expect embedded form

vital turtle
#

Sure and when you do that you see a button which then opens up a modal to collect an email/password, correct?

#

Or do you not see an embedded button at all?

somber spade
#

correct

vital turtle
#

Okay so yeah that button which leads to a popout modal is because you are collecting external accounts via embedded onboarding. This means that your users need to enter an email/password so that they can manage their external account. That occurs in a new window.

#

If you collect external accounts yourself, then this would not happen and the entire onboarding flow would be embedded

somber spade
#

ok

#

so how can i do this?

#

how can i collect external accs myself? and what exactly are external accs?

vital turtle
somber spade
#

so

#

would i need to pass and give this information of external accs on the create stripe connect account or create stripe connect session?

#

on which moment exactly /

vital turtle
obtuse masonBOT
somber spade
#

ok

#

so what exact information do i need to pass in this code?

#

const account = await stripe.accounts.create({ type: 'custom', country: 'BR', email: data.email, capabilities: { card_payments: { requested: true }, transfers: { requested: true } }, business_type: 'individual', });

spark bone
#

Hello bismark is stepping out soon so I am taking over the thread. Catching up now...

somber spade
#

ok

spark bone
#

So as those doc sections say, you can pass the same parameters that the create external account call needs or you can separately create a token and then pass that. I'd suggest trying the first method as that is less API calls
https://docs.stripe.com/api/external_account_bank_accounts/create
https://docs.stripe.com/api/tokens/create_bank_account

somber spade
#

im not understanding

#

// Create a new Stripe account for the user const account = await stripe.accounts.create({ type: 'custom', country: 'BR', email: data.email, capabilities: { card_payments: { requested: true }, transfers: { requested: true } }, business_type: 'individual', });

#

what fiels should i add here?

#

should i do this

const externalAccount = await stripe.accounts.createExternalAccount( 'acct_1032D82eZvKYlo2C', { external_account: 'btok_1NAiJy2eZvKYlo2Cnh6bIs9c', } );

then this

// Create a new Stripe account for the user const account = await stripe.accounts.create({ type: 'custom', country: 'BR', email: data.email, capabilities: { card_payments: { requested: true }, transfers: { requested: true } }, business_type: 'individual', });

#

or should i do this

// Create a new Stripe account for the user const account = await stripe.accounts.create({ type: 'custom', country: 'BR', email: data.email, externalAccount = await stripe.accounts.createExternalAccount( 'acct_1032D82eZvKYlo2C', { external_account: 'btok_1NAiJy2eZvKYlo2Cnh6bIs9c' }, capabilities: { card_payments: { requested: true }, transfers: { requested: true } }, business_type: 'individual', });

#

externalAccount = await stripe.accounts.createExternalAccount( 'acct_1032D82eZvKYlo2C', { external_account: 'btok_1NAiJy2eZvKYlo2Cnh6bIs9c', }

in acct_1032D82eZvKYlo2C is this the acc id ?

spark bone
#

You can do the btok token, the alternative is passing account_number, country, currency, account_holder_name, and account_holder_type to the external_account hash in your account creation call

somber spade
#

so how would my json look like?

#

i need you to be clearer

#

im confused

spark bone
#

Wait whoops I edited the wrong example of yours

#

Is this helpful?

      type: 'custom',
      country: 'BR',
      email: data.email,
      capabilities: {
        card_payments: { requested: true },
        transfers: { requested: true }
      },
      business_type: 'individual',
      external_account:  { 
        account_number: '12345',
        country: 'US',
        ...
      }
    });```
somber spade
#

so not use the btok token ?

#

external_account: { account_number: '12345', country: 'US', ...

#

but i woudlnt have acc number or country before creating them?

#

shouldn't i create the external account on the stripe.accounts.create?

spark bone
#

Correct, that is how you pass the data directly in to the call instead of using a bank account token. If you don't want that pop up modal, you will need to collect these details yourself at some point. If you don't want to do this on account creation, you can do the same thing from that create call except in an update call after the user has filled out their initial info.

somber spade
#

i do not understand

#

im super confused

#

external_account are bank accounts correct?

spark bone
#

Correct

somber spade
#

ok

#

and i need to have ext acc info before rendering the embedded form

#

otherwise it will render a redirect btn

#

correct?

#

?

#

are you there?

spark bone
somber spade
#

that's not what bismarck told me

#

how can i add this code

spark bone
#

I don't think bismark commented on that when I read that message

somber spade
#

onto this code?

#

i want to create an external acc on the stripe.accounts.create

spark bone
somber spade
#

yes, but i mentioned that i dont have any information

external_account: { account_number: '12345', country: 'US', ..``

#

on acc unmber or country

#

how can i pass information to external_account

#

if i dont have any ?

#

and this piece of code

#

const externalAccount = await stripe.accounts.createExternalAccount( 'acct_1032D82eZvKYlo2C', { external_account: 'btok_1NAiJy2eZvKYlo2Cnh6bIs9c', } );

#

is telling me to generate the information with a token

spark bone
#

In that case, you wouldn't pass that info on account creation. You would create the account, have our embedded onboarding collect the rest of their info, collect the external account info yourself, and then use that to add an external account to your connected Account via the update account call.

somber spade
#

in which case?

#

i mentioned 2 cases

spark bone
#

Not sure what you mean by that. Are you talking about accounts.create and accounts.createExternalAccount as the two cases here? Or something else?

somber spade
#

bro

#

let me try to explain again

#

const account = await stripe.accounts.create({ type: 'custom', country: 'BR', email: data.email, capabilities: { card_payments: { requested: true }, transfers: { requested: true } }, business_type: 'individual', });

#

on the stripe.accounts.create

#

should I

  1. Create an external account as well during the stripe.accounts.create, like this:
#

``// Create a new Stripe account for the user
const account = await stripe.accounts.create({
type: 'custom',
country: 'BR',
email: data.email,
externalAccount = await stripe.accounts.createExternalAccount(
'acct_1032D82eZvKYlo2C',
{ external_account: 'btok_1NAiJy2eZvKYlo2Cnh6bIs9c' },
capabilities: {
card_payments: { requested: true },
transfers: { requested: true }
},
business_type: 'individual',
});
externalAccount = await stripe.accounts.createExternalAccount(
'acct_1032D82eZvKYlo2C',
{
external_account: 'btok_1NAiJy2eZvKYlo2Cnh6bIs9c',
}`

#

passing externalAccount = await stripe.accounts.createExternalAccount( 'acct_1032D82eZvKYlo2C', inside the stripe.accounts.create object

#
  1. Or should I first create the external account

const externalAccount = await stripe.accounts.createExternalAccount( 'acct_1032D82eZvKYlo2C', outside the stripe.accounts.create object

#

and only then pass the recently created external acc to the stripe.accounts.create object

#

const account = await stripe.accounts.create({ type: 'custom', country: 'BR', email: data.email, capabilities: { card_payments: { requested: true }, transfers: { requested: true } }, external_account = ? business_type: 'individual', });

spark bone
#

You can't do either of those if you don't have the bank account info up front

#

If you don't have the info up front, you have to onboard the account without it and then add the bank account later

somber spade
#

ok, so what bank account info do i need upfront? in order to be able to create stripe external acc

spark bone
#

The data that the external account create call takes, namely account_number, country, currency, account_holder_name, and account_holder_type

somber spade
#

where can i see this in the docs?

spark bone
#

Unfortunately I am not finding a doc that demonstrates this specific flow. You could pass it in the way that I demonstrated in the message with the account create call #1254820624279404646 message

#

Taking a step back, is there a specific reason that you want to avoid this modal? It may be easier to address that issue and enable you to use Financial Connections, which would make this process much easier

somber spade
#

i do not wish to do the modal

#

i want the form to be embedded

#

` const account = await stripe.accounts.create({
type: 'custom',
country: 'BR',
email: data.email,
capabilities: {
card_payments: { requested: true },
transfers: { requested: true }
},
business_type: 'individual',
external_account: {
account_number: '12345',
country: 'US',
...
}
});``

#

here there's external_account: { account_number: '12345', country: 'US',

somber spade
#

like : namely account_number, country, currency, account_holder_name, and account_holder_type

#

so what should i do ?

spark bone
#

Pass them in the same hash

#

That is what the ... placeholder represented.

#

If you try to write that call and fill out all of those fields within the same external_account hash, I think that will make it clearer

somber spade
#

what do you mean?

#

i dont understand

#

can u show me what im supposed to do?

spark bone
#

Can you tell me more about which part is confusing? I already showed where those parameters go, are you trying to understand what data goes in to each? Or something else?

#

Also if this is just a UI preference, I would highly reccommend reconsidering this. Allowing users to use our pre-built popup would make this a smoother experience for most users and would be easier for your to code as you wouldn't need your own bespoke workaround.

somber spade
#

i do not wish to do the modal
i want the form to be embedded
` const account = await stripe.accounts.create({
type: 'custom',
country: 'BR',
email: data.email,
capabilities: {
card_payments: { requested: true },
transfers: { requested: true }
},
business_type: 'individual',
external_account: {
account_number: '12345',
country: 'US',
...
}
});``
here there's external_account: {
account_number: '12345',
country: 'US',
Vítor Zucher — Hoje às 19:47
but here you've mentioned multiple other fields
like : namely account_number, country, currency, account_holder_name, and account_holder_type
so what should i do ?

#

like

#

what params should i pass to this object?

spark bone
#

They go in the same external_account parameter that the other external account fields go in to.

somber spade
#

ok

obtuse masonBOT