[英]stripe: No such external account but the external account do exist
I create an account in stripe under test
module by stripe api. 我通过stripe api在test
模块下的stripe中创建一个帐户。 And bind a bank account with this account. 并将银行帐户与此帐户绑定。 Go to Stripe dashboard -> connect -> accounts
, I could see the account which I created. 转到Stripe dashboard -> connect -> accounts
,我可以看到创建的帐户。 Click it and to see the detail, I could see the external accounts: 单击它,然后查看详细信息,我可以看到外部帐户:
but when I want to create a payout to this bank account: 但是当我想为此银行帐户创建付款时:
curl https://api.stripe.com/v1/payouts \
-u sk_test_*********: \
-d amount=400 \
-d currency=usd \
-d destination=ba_1CrVQnJziGn15h8UAvSlEUfI \
-d source_type=bank_account
It gives me error: 它给我错误:
{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such external account: ba_1CrVQnJziGn15h8UAvSlEUfI",
"param": "destination",
"type": "invalid_request_error"
}
}
Here's the correct code to do this. 这是执行此操作的正确代码。
When trying to list payouts on a connected account, you have to make the API request authenticating as this account so in addition to the destination bank account ID you need to pass the stripe account ID. 尝试列出已连接帐户的支出时,您必须使API请求以此帐户进行身份验证,因此,除了目标银行帐户ID外,还需要传递带区帐户ID。
payouts = Stripe::Payout.list(
{:destination => external_account},
{:stripe_account => "acct_XXXXXX"},
)
According to Stripe docs , in order to create Payouts for connected accounts you must specify the connected account on the request: 根据Stripe docs的说明 ,要为关联帐户创建付款,您必须在请求中指定关联帐户:
curl https://api.stripe.com/v1/payouts \
-u {PLATFORM_SECRET_KEY}: \
-H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}" \
-d amount=1000 \
-d currency=usd
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.