【问题标题】:How to make a payment Intent to charge a connected account in Stripe如何付款 意图在 Stripe 中向已连接的帐户收费
【发布时间】:2020-03-07 15:36:22
【问题描述】:

我想创建一个 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 上,因为它们需要某种进一步的身份验证。来自 Stripe 文档

如果您选择直接收费,则需要确保 连接的帐户已启用您打算使用的付款方式 采用。直接收费需要在连接时创建 PaymentMethods 帐户....

如果您从服务器创建 PaymentMethods,您 可以使用 Stripe-Account 标头进行身份验证 我们支持的任何库。

我会努力的,看看怎么做

【问题讨论】:

  • 这段代码是正确的。如果您收到错误,可能是您无权访问您在stripe_account 中传递的帐户。在不知道这里的确切错误的情况下提供帮助有点棘手。另外,您可能想直接与 Stripe 的支持团队交谈,因为这是您连续第三个关于 PaymentIntents 的问题。
  • 这是错误@koopajah Error: No such payment_method: pm_1FdmPxxxxxxxxx; OAuth key or Stripe-Account header was used but API request was provided with a platform-owned payment method ID. Please ensure that the provided payment method matches the specified account.
  • 你没有表明你做错了什么。
  • 代码正确。问题出在 Stripe 上——我做了一个 edit2 评论
  • 问题是在平台上创建了PaymentMethod,然后您尝试在连接的帐户上使用它。那永远行不通。您需要查看此文档:stripe.com/docs/payments/payment-methods/…

标签: node.js stripe-payments


【解决方案1】:

我找到了这个https://medium.com/flutter-community/build-a-marketplace-in-your-flutter-app-and-accept-payments-using-stripe-and-firebase-72f3f7228625,它描述了如何为关联的帐户收费。

基本上你需要在服务器中克隆你的支付方式,然后创建你的支付意图

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

【讨论】:

  • 您是如何克隆付款方式的?链接坏了
  • 链接已更新。看看
猜你喜欢
  • 2020-12-02
  • 2021-07-20
  • 1970-01-01
  • 2023-03-18
  • 2015-07-16
  • 1970-01-01
  • 2015-03-01
  • 2017-08-01
  • 2015-11-10
相关资源
最近更新 更多