[英]Stripe: Send payout to customers' external bank account or debit card
我正在嘗試向用戶添加的外部銀行帳戶或借記卡付款,但我收到類似No such external account: ''
錯誤
我已經使用https://stripe.com/docs/api/external_accounts#external_accounts這個 object 添加了一個外部銀行賬戶或卡,並且我可以添加一個銀行賬戶和卡,當我使用這些詳細信息進行支付時,它會給出一個錯誤。
我的要求是:用戶有他們的個人錢包來存儲金額。 每當用戶想要提取資金時,他們可以添加銀行賬戶或借記卡,然后他們可以將金額記入他們的銀行。
謝謝
要匯款,您必須將用戶信息保存在 Stripe 中。 將注冊按鈕插入 Stripe。 然后將 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
現在您可以通過以下方式匯款:
const stripe = require('stripe')(StripeSecretKey);
const stripeUser = await DB.find(id); // example
await stripe.transfers.create({
amount,
currency,
destination: stripeAccount.stripeAccountId,
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.