我正在使用Stripe Connect进行条带集成。在此,我们首先在现有条带帐户下创建一个托管帐户。然后我们向客户收取费用,并将费用转移到一个帐户并将应用程序费用转移到管理帐户。通过创建托管帐户,我们可以使用以下方式获取与其关联的帐户ID:
$acc=\Stripe\Account::create(
array(
"country" => "US",
"managed" => true
)
);
然后我们使用申请费概念向客户收取并使用该费用链接两个帐户如下:
$c_charge = \Stripe\Charge::create(
array(
"amount" => 1000, // amount in cents
"currency" => "usd",
"source" => {TOKEN OF CUSTOMER},
"description" => "Example charge",
"application_fee" => 123 // amount in cents
),
array("stripe_account" => 'acct_15rTMLISz4VN6mw2')
);
在这种情况下,由于与申请费相关联的条带帐户没有连接银行帐户进行汇款,所以现在我们需要将银行帐户与条带帐户相关联
以下代码基于它,但它会生成错误:无效的令牌ID
$data=array(
'bank_account'=> $token
);
$pHttp_headers=array(
"Content-Type: application/x-www-form-urlencoded",
"Authorization: Bearer {$stripe['secret_key']}"
);
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,"https://api.stripe.com/v1/accounts/acct_15rTMLISz4VN6mw2/bank_accounts");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $pHttp_headers);
//curl_setopt($ch, CURLOPT_USERPWD,$stripe['secret_key']);
$pResult = curl_exec($ch);
curl_close($ch);
$pResult=json_decode($pResult,true);
这是我得到的错误:
Array ( [error] => Array ( [type] => invalid_request_error [message] => Invalid token id: tok_15rlFFHPiBMaAbxH6hwPNcDL [param] => bank_account ) )
有什么想法吗?