stripe-payments - 传递 application_fee 时出现 Stripe API 错误

标签 stripe-payments stripe-connect

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

Stripe 提示它需要以下任何一个:OAuth key 、Stripe-Account header 或目标参数。

我路过Stripe-Account标题。

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

这是我的 curl 请求:

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 预计您将代表已连接的帐户向客户收费。申请费是应进入您的平台账户的金额,作为您提供服务的费用。

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

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

关于stripe-payments - 传递 application_fee 时出现 Stripe API 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31909342/

相关文章:

node.js - 如何使用 Firebase 云函数向客户端(Swift)发送 strip 响应

java - 将 Stripe 与多个电子商务客户端结合使用

ios - 获取 POST 内容类型错误

ios - 使用 Stripe iOS SDK 标记银行信息

javascript - 将 JSON 添加到 Parse.Cloud.httpRequest "application/x-www-form-urlencoded"

android - 我的 Android 电子叫车应用的移动支付集成

google-play - react 原生谷歌支付和 Stripe 集成错误

stripe-payments - Stripe : No such external account but the external account do exist

php - 将资金从一个 Stripe 账户转移到另一个 Stripe 账户

javascript - 创建管理帐户而不在后端存储任何数据