简体   繁体   English

如何付款 意图在 Stripe 中向已连接的帐户收费

[英]How to make a payment Intent to charge a connected account in Stripe

I would like to create a Stripe PaymentIntent with a direct charge to a connected account我想创建一个 Stripe PaymentIntent,直接向连接的账户收费

Here is what I wrote这是我写的

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

What am I doing wrong??我究竟做错了什么??

The following code (without the connected account) works fine以下代码(没有连接的帐户)工作正常

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

I suspect that is culprit because the console error says something about PaymentMethod....我怀疑这是罪魁祸首,因为控制台错误说明了 PaymentMethod....

EDIT : The code is correct and I found out that the issue is with Stripe because they requires some sort of further authentication.编辑:代码是正确的,我发现问题出在 Stripe 上,因为它们需要某种进一步的身份验证。 From Stripe documentation来自 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....直接收费需要在关联账户上创建 PaymentMethods....

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.如果您从服务器创建 PaymentMethods,则可以使用 Stripe-Account header 和我们支持的任何库进行身份验证。

I will work on it and see how to do it我会努力的,看看怎么做

I have found this https://medium.com/flutter-community/build-a-marketplace-in-your-flutter-app-and-accept-payments-using-stripe-and-firebase-72f3f7228625 which describes how to charge a connected account.我发现这个https://medium.com/flutter-community/build-a-marketplace-in-your-flutter-app-and-accept-payments-using-stripe-and-firebase-72f3f7228625描述了如何收费关联帐户。

Basically you need to clone your payment methods in the server and then create your payment intent基本上你需要在服务器中克隆你的支付方式,然后创建你的支付意图

Stripe docs for cloning payment methods: https://stripe.com/docs/connect/cloning-saved-payment-methods用于克隆支付方式的 Stripe 文档: https://stripe.com/docs/connect/cloning-saved-payment-methods

暂无
暂无

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

相关问题 为关联帐户创建条带费用 - 没有此类客户 - Create Stripe Charge for Connected Account - No Such Customer 将 Stripe 平台客户克隆到关联账户客户时出现问题 - 没有这样的 payment_intent: 'pi_abc...zyx' - Issues cloning a Stripe platform customer to a Connected Account Customer - No such payment_intent: 'pi_abc...zyx' 如何确认条带中的成功付款费用 - How to confirm successful payment charge in stripe 已解决 - Stripe Clone 客户并在连接的帐户上创建直接收费 - Solved - Stripe Clone Customer and Create Direct Charge on Connected Account 如何从连接的帐户(Node.js)中检索付款的 Stripe 费用 - How to retrieve the Stripe fee for a payment from a connected account (Node.js) 将Stripe收费ID和关联帐户的帐户ID暴露给客户端是否安全? - Is it safe to expose Stripe charge id and account Id of connected account to client side? 如何从Cloud Function for Firebase获取条带化付款费用“成功”? - How to get a stripe payment charge 'success' from a Cloud Function for Firebase? 如何在条带中的付款意图示例中自定义付款方式 - How to customize the payment method in payment intent example in stripe 保存卡以便稍后在欧盟对连接的条带帐户收费(使用 SCA)。 反应和节点 - Saving a card to charge a connected stripe account later in EU (using SCA). React & Node 条带连接费用 - 必须作为连接帐户进行身份验证才能使用客户参数 - Stripe Connect Charge - Must authenticate as a connected account to be able to use customer parameter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM