传递 application_fee 时出现 Stripe API 错误 [英] Stripe API error when passing application_fee

查看:23
本文介绍了传递 application_fee 时出现 Stripe API 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Stripe API 收取申请费.我确定我在请求中遗漏了一些东西.

I am trying to collect an application fee using the Stripe API. I am sure I am missing something in the request.

Stripe 抱怨它需要以下任一项:OAuth 密钥、Stripe-Account 标头或目标参数.

Stripe complaints that it needs either of these: OAuth key, the Stripe-Account header, or the destination parameter.

我正在传入 Stripe-Account 标头.

你能指出我正确的方向吗?

Could you please point me into the right direction?

这是我的 curl 请求:

Here is my curl request:

curl https://api.stripe.com/v1/charges \
    -u sk_test_<key>: \
    -H "Stripe-Account: acct_<key>" \
    -d amount=2000 -d currency=usd -d capture=true \
    -d card=tok_<key> -d description="curl" -d application_fee=48

这是我得到的回复:

{
  "error": {
    "type": "invalid_request_error",
    "message": "Can only apply an application_fee when the request is made on behalf of another account (using an OAuth key, the Stripe-Account header, or the destination parameter).",
    "param": "application_fee"
  }
}

推荐答案

将我对此问题的经验添加到上述评论中 - 当您在请求中包含申请费时,Stripe 预计您将代表客户收费的关联账户.申请费是应进入您的平台账户的金额,作为您提供服务的费用.

To add my experience of this issue to the comments above – when you include an application fee in the request, Stripe expects that you will be charging a customer on behalf of a connected account. The application fee is the amount that should go to your platform account, as your fee for the service you provide.

如果 Stripe 认为被支付的账户是平台账户,则抛出此错误,因此对同一账户单独处理申请费是没有意义的.发生这种情况的方式包括在请求中传递您的平台帐号而不是连接的帐号,或者将目标参数设置为 null.

Stripe throws this error if it believes that the account being paid is the platform account, and therefore it makes no sense to process a separate application fee to the same account. Ways this can happen include passing in your platform account number instead of a connected account number in the request, or a destination parameter that is set to null.

解决方案是仔细检查您付款的帐户不是您的平台帐户,或者如果费用将转到您的平台,则不包括申请费.我会添加指向文档相关部分的链接,但我不知道这在任何地方都有涉及.

The solution is to double check the account you are making payment to is not your platform account, or not include the application fee if the charge is going to your platform. I would add a link to the relevant part of the documentation, but I'm not aware of this being covered anywhere.

这篇关于传递 application_fee 时出现 Stripe API 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆