简体   繁体   English

Stripe:将付款发送到客户的外部银行账户或借记卡

[英]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: ''我正在尝试向用户添加的外部银行帐户或借记卡付款,但我收到类似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.我已经使用https://stripe.com/docs/api/external_accounts#external_accounts这个 object 添加了一个外部银行账户或卡,并且我可以添加一个银行账户和卡,当我使用这些详细信息进行支付时,它会给出一个错误。

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.要汇款,您必须将用户信息保存在 Stripe 中。 Insert the registration button into Stripe.将注册按钮插入 Stripe。 Then store the Stripe user id in the database:然后将 Stripe 用户 id 存储在数据库中:

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 .更多关于转移oauth的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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