gpt4 book ai didi

node.js - 如何付款 意图在 Stripe 中向关联账户收费

转载 作者:行者123 更新时间:2023-12-04 14:52:47 25 4
gpt4 key购买 nike

我想创建一个 Stripe PaymentIntent,直接向关联账户收费

这是我写的

stripe.paymentIntents.create(
{
amount: 2000,
currency: 'gbp',
payment_method: 'pm_xxxx',
}, {
stripe_account: 'acct_1F2xxxxxxxxxx'
},
function(err, paymentIntent) {
// asynchronously called
// do something here
}
);

我究竟做错了什么??

以下代码(没有连接的帐户)工作正常
stripe.paymentIntents.create(
{
amount: 2000,
currency: 'gbp',
payment_method: 'pm_xxxx',
},
function(err, paymentIntent) {
// asynchronously called
// do something here
}
);

我怀疑这是罪魁祸首,因为控制台错误说明了 PaymentMethod ....

编辑 :代码是正确的,我发现问题出在 Stripe 上,因为它们需要某种进一步的身份验证。来自条纹文档

If you opt for direct charges, you will need to make sure that the connected account is onboarded on the payment method you intend to use. Direct charges require creating PaymentMethods on connected accounts....

If you’re creating PaymentMethods from the server, you can make use of authentication using the Stripe-Account header with any of our supported libraries.



我会努力,看看怎么做

最佳答案

我找到了这个 https://medium.com/flutter-community/build-a-marketplace-in-your-flutter-app-and-accept-payments-using-stripe-and-firebase-72f3f7228625它描述了如何向连接的帐户收费。
基本上,您需要在服务器中克隆您的付款方式,然后创建您的付款意图
克隆支付方式的条纹文档:https://stripe.com/docs/connect/cloning-saved-payment-methods

关于node.js - 如何付款 意图在 Stripe 中向关联账户收费,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58809995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com