#fonseca_connect-payout2

1 messages ¡ Page 1 of 1 (latest)

grim hedgeBOT
naive juncoBOT
#

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.

grim hedgeBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1238186923214766121

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

pine lake
#

Hello again haha

devout willow
#

@pine lake I assume that you're mixing up your own bank account id as a platform and the id of a bank account of a connected account

#

fonseca_connect-payout2

pine lake
#
 async setupBankAccount(
    connectedAccountId: string,
    data: NewBankMessage,
    name: string,
  ) {
    const account = await this.stripe.accounts.retrieve(connectedAccountId);
    const routing_number = `${data.bank}-${data.agencyNumber}`;

    try {
      const token = await this.stripe.tokens.create(
        {
          bank_account: {
            country: 'BR',
            currency: 'brl',
            account_number: data.accountNumber,
            routing_number,
            account_holder_name: name,
            account_holder_type:
              account.business_type === 'company' ? 'company' : 'individual',
          },
        },
        {
          stripeAccount: connectedAccountId,
        },
      );

      if (token.id) {
        const bank = await this.stripe.accounts.createExternalAccount(
          connectedAccountId,
          {
            external_account: token.id,
          },
          {
            stripeAccount: connectedAccountId,
          },
        );

        await this.stripe.accounts.update(connectedAccountId, {
          external_account: bank.id,
        });

        return bank;
      }
    } catch (error) {
      console.log(error);
    }
  }
#

This my code

devout willow
#

that's unlikely to be the code that cases the error though

#

Sorry can you try and explain the exact issue? Which exact line of code is throwing that specific error

pine lake
#

to create where the transfers will be sent to the connect user

#

transfer account***

devout willow
#

I'm sorry you're being really vague right now because you're deep in this already.
Take a couple steps back, look at the exact code and let me know the exact API request that causes that error and what parameters you send to that API

pine lake
#

but the bank is created in stripe

#

is the unique function what I execute

#

when will create a external Account

#

hello?

devout willow
#

sorry looking

#

Right now you seem to mix up a lot of words/concepts like external account, account, transfer, payout. I'm not really understanding what the problem is and you haven't really said whiche exact line of code is failing. You have to debug this first

#

Did you figure it out?

grim hedgeBOT