简体   繁体   中英

Stripe: Send payout to customers' external bank account or debit card

I am trying to send payout to users' added external bank account or debit card and I am getting error like No such external account: ''

I have added an external bank account or card usinghttps://stripe.com/docs/api/external_accounts#external_accounts this object and I am able to add a bank account and card and when I use those details with payout then It gives an error.

What my requirement is: User has their personal wallet where the amount is getting stored. whenever user want to withdraw fund they can add either a bank account or debit card after that they can credit their amount to their bank.

Thanks

To send money you must save the user's information in Stripe. Insert the registration button into Stripe. Then store the Stripe user id in the database:

const stripe = require('stripe')(StripeSecretKey);

const stripeUser = await stripe.oauth.token({
      grant_type: 'authorization_code',
      code,
});

DB.save(stripeUser.stripe_user_id); // example

Now you can send money this way:

const stripe = require('stripe')(StripeSecretKey);

const stripeUser = await DB.find(id); // example

await stripe.transfers.create({
      amount,
      currency,
      destination: stripeAccount.stripeAccountId,
});

More about transfers and oauth .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM