#hammad-umar_code

1 messages ยท Page 1 of 1 (latest)

arctic juncoBOT
#

๐Ÿ‘‹ 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/1266009680950329384

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

mystic yarrowBOT
#

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.

solar sinew
#

hi there!

#

I think the error message is pretty clear

gritty veldt
#

How can i add balance in test account for testing payout ?

solar sinew
gritty veldt
#

Can you provide me any code snippet for adding balance in my test account for testing payout ?

solar sinew
gritty veldt
#

after doing this can i make payout to other user bank accounts ?

solar sinew
#

no, you can only make a payout to your own bank account

#

unless you are using Stripe Connect

gritty veldt
#

how can i create payout for other user bank accounts ?

solar sinew
#

what do you mean by "other user"? do you mean a Connected Account?

gritty veldt
#

I am creating a service based application in which user can add their bank accounts and from admin side i release funds to their bank accounts that's my scenerio.

#

how can user add their bank accounts and how can i send money to their accounts please guide me and tell me the full flow

solar sinew
#

are you using Stripe Connect, are does your users have a Stripe account?

gritty veldt
#

I am using stripe test account not yet stripe connect ? My users dont have stripe account yet.

solar sinew
#

the only way to send money to users is if you are using Stripe Connect, and the users have a Stripe account connected to your own account.

gritty veldt
#

Is my stripe account should be verified ? All steps completed ?

#

Please guide me step by step and share with me docs for doing that ... first of all creating my connect account then creating users stripe accounts then create payouts to their bank accounts

#

???

arctic juncoBOT
solar sinew
gritty veldt
#

Ok, I think express account should be good for our scenerio.

#

Then what's the next step ?

cobalt mortar
#

๐Ÿ‘‹ stepping in for soma as they need to step away

gritty veldt
#

ok no problem

cobalt mortar
#

After that you can create Transfers to that account

gritty veldt
#

Is my stripe connect account should be verified and all steps completed for testing this scenerio ?

cobalt mortar
#

Nope

#

You only need an enabled test-mode Connected Account

#

Your platform does not need any verification

gritty veldt
#

and which API is used for payouts ?

cobalt mortar
#

Payouts or Transfers?

gritty veldt
#

router.get("/testing-stripe", async (_, res) => {
try {
// Create a Stripe express account
const account = await stripe.accounts.create({
type: "express",
country: "US",
email: "hammadumar8080@gmail.com",
business_type: "individual",
individual: {
first_name: "Hammad",
last_name: "Umar",
},
capabilities: {
card_payments: { requested: true },
transfers: { requested: true },
},
});

// Create a bank account token
const token = await stripe.tokens.create({
  bank_account: {
    country: "US",
    currency: "usd",
    account_holder_name: "Hammad Umar",
    account_holder_type: "individual",
    routing_number: "110000000",
    account_number: "000123456789",
  },
});

// Attach the bank account token to the Custom account
const bankAccount = await stripe.accounts.createExternalAccount(
  account.id,
  {
    external_account: token.id,
  }
);

// Generate onborading link
const accountLink = await stripe.accountLinks.create({
  account: account.id,
  refresh_url: "http://localhost:5002/redirect",
  return_url: "http://localhost:5002/redirect",
  type: "account_onboarding",
});

// "bankAccountId": "ba_1PgQ17Q9iL3erqVymxQEwI47",
// "stripeAccountId": "acct_1PgQ13Q9iL3erqVy"

const payout = await stripe.payouts.create(
  {
    amount: 10000, // Amount in cents (e.g., $100)
    currency: "usd",
    destination: "ba_1PgQ17Q9iL3erqVymxQEwI47",
  },
  {
    stripeAccount: "acct_1PgQ13Q9iL3erqVy",
  }
);

return res.json({
  payout,
});

} catch (error) {
console.error("Error creating bank token:", error);
return res.status(500).json({ message: error.message });
}
});

cobalt mortar
#

Payouts are when funds go from a Stripe Account to an external account (like a bank account)

gritty veldt
#

that's my code

cobalt mortar
#

Transfers are when funds move from your Platform to a Connected Account

#

You don't need to collect the bank account here at all with Express

gritty veldt
#

when i create payout i got this error

{
"message": "You have insufficient funds in your Stripe account for this transfer. Your card 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)."
}

cobalt mortar
#

All you need is to create the account and then create the Account Link and visit the URL that is in the response for the Account Link

#

Then fill in all of the information in Connect Onboarding at that link

gritty veldt
#

got this error

{
"message": "You have insufficient funds in your Stripe account for this transfer. Your card 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)."
}

#

when i create payout

cobalt mortar
#

My colleague already explained that

#

You have to add funds to your balance using the Available balance card

gritty veldt
#

can you refactor my code and send me Plz ?

cobalt mortar
#

No

#

We don't write code for you here

gritty veldt
#

where you write code ?

cobalt mortar
#

Not sure what you mean. The purpose of this discord server is to help unblock developers when they have questions about the Stripe API. We don't build your integration for you. If you need help writing code then you need to hire a developer