Nik*_*hal 5 php stripe-payments stripe-connect
我正在创建付款,在运行代码时出现错误
Sorry, you don't have any external accounts in that currency (usd)
Run Code Online (Sandbox Code Playgroud)
首先我创建客户,然后我创建银行帐户,然后我进行付款,任何人都可以帮我解决这个问题,这是我的代码
<?php
require_once('init.php');
\Stripe\Stripe::setApiKey("*************");
$customer = \Stripe\Customer::create(array(
"description" => "Customer for payout"
));
$customer_id = $customer->id;
$customer = \Stripe\Customer::retrieve($customer_id);
$bank_data = \Stripe\Token::create(array(
"bank_account" => array(
"country" => "US",
"currency" => "usd",
"account_holder_name" => "Charlotte Thomas",
"account_holder_type" => "individual",
"routing_number" => "110000000",
"account_number" => "000123456789"
)
));
$bank_token = $bank_data->id;
$bank_account = $customer->sources->create(array("source" => $bank_token));
$payout_data = \Stripe\Payout::create(array(
"amount" => 100,
"currency" => "usd",
));
echo "<pre>";
print_r($payout_data);
die;
?>
Run Code Online (Sandbox Code Playgroud)
对于付款,如果这是您自己的 Stripe 账户,您需要在仪表板https://dashboard.stripe.com/account/payouts中输入您的银行账户详细信息。如果您希望能够通过 API 创建付款,您还需要将付款计划设置为“手动”。
另请注意,创建费用时,资金不会立即可用,因此您无法在创建费用后立即创建付款。您可以在 Stripe 文档中阅读有关付款的所有信息:https://stripe.com/docs/payouts。
| 归档时间: |
|
| 查看次数: |
2391 次 |
| 最近记录: |