尝试支付到bank_account时,没有这样的外部帐户条带

时间:2017-12-21 08:57:33

标签: curl stripe-payments

我试图使用条带进行付款,所以我做的第一件事是使用

检查我的可用余额
curl https://api.stripe.com/v1/balance
-u sk_test_MkyVP8GpUk______:

它返回:

{
  "object": "balance",
  "available": [
    {
      "currency": "usd",
      "amount": 6004,
      "source_types": {
      "card": 52,
      "bank_account": 5952
    }  
 }
],
  "connect_reserved": [
    {
      "currency": "usd",
      "amount": 0
    }
  ],
  "livemode": false,
  "pending": [
    {
      "currency": "usd",
      "amount": 6351,
      "source_types": {
      "card": 12303,
      "bank_account": -5952
     }
   }
 ]
}

我从这个回答中理解的是avaiable[card] = 52这意味着如果我想要对信用卡付款,那么它应该是足够的金额,现在有{59.52美元avaiable[bank_account] 1}},所以我决定使用他们使用的API文档向条带帐户的外部帐户付款:

curl https://api.stripe.com/v1/payouts \
-u sk_test_MkyVP8GpUkur______: \
-d amount=400 \
-d currency=usd \
-d destination=ba_1B3jVULjo5______ \
-H "Stripe-Account: acct_1B0T___"

此目的地(ba_1B3jVULjo5____)是该帐户ID的外部帐户,问题是当我处理此curl时,它会给我:

{
  "error": {
    "type": "invalid_request_error",
    "message": "You have insufficient funds in your Stripe account for this transfer. Your card balance is too low.  You can use the the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance).",
    "param": "destination"
  }
}

我如何解决此问题?我对type_source余额avaiable的理解是否正确?

我确保该帐户中还有一个外部帐户。

提前致谢。

1 个答案:

答案 0 :(得分:1)

尝试在source_type中添加payout creation request参数:

curl https://api.stripe.com/v1/payouts \
  -u sk_test_...: \
  -H "Stripe-Account: acct_..." \
  -d amount=400 \
  -d currency=usd \
  -d destination=ba_... \
  -d source_type=bank_account

请注意,您可以完全省略destination参数,除非该货币有多个银行帐户,并且您希望将资金发送到非默认银行帐户。