【问题标题】:StripeInvalidRequestError when cancelling subscription on connected account取消已连接帐户的订阅时出现 StripeInvalidRequestError
【发布时间】:2017-12-29 19:53:11
【问题描述】:

我正在尝试取消已连接帐户上的条带订阅(处于测试模式),但出现以下错误:

StripeInvalidRequestError: No such subscription: SUBSCRIPTION_ID

我可以在我的 Stripe 仪表板中看到带有 SUBSCRIPTION_ID 的订阅,然后从那里取消它。我尝试了以下方法,有无 stripe_account 参数:

 stripe.subscriptions.del(
   SUBSCRIPTION_ID, { at_period_end: true }
 ), {
    stripe_account: stripeAccountId
 };

我可以毫无问题地取消平台帐户上的订阅。我是否需要先使用已连接帐户的 API 密钥进行身份验证?还是我应该在这里使用另一种方法?

编辑:订阅在 ID 匹配 stripeAccountId 的帐户上

【问题讨论】:

  • Stripe 帐户中的订阅是否与stripeAccountId 关联? stripeAccountId 中真的有值吗?
  • 其实有一个值,和订阅关联的账号匹配
  • 如果你提供的SUBSCRIPTION_ID 不属于stripeAccountId,或者它属于,但stripeAccountId 实际上是undefined .如果您使用console.log() SUBSCRIPTION_ID 和stripeAccountId,您会得到什么?您可能还想写信给支持人员,以便他们为您查看详细信息:support.stripe.com/email/login
  • 两者都已定义并且是正确的值。将仪表板视为 ID 为stripeAccountId 的帐户,我可以看到SUBSCRIPTION_ID 的订阅,并且可以在那里手动取消它。所以我在这里不知所措。我会联系 Stripe 支持

标签: node.js stripe-payments stripe-connect


【解决方案1】:

最后,这是一个错字。我放错了一个右括号。这是更正后的 API 调用

stripe.subscriptions.del(SUBSCRIPTION_ID, {
  at_period_end: true
}, {
  stripe_account: stripeAccountId
});

【讨论】:

    猜你喜欢
    • 2019-04-29
    • 2021-04-04
    • 2019-10-18
    • 1970-01-01
    • 2013-09-07
    • 2023-03-17
    • 2021-04-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多