条纹创建支付获取错误"抱歉,您没有该货币的任何外部帐户(usd)"

时间:2018-01-19 05:52:34

标签: php stripe-payments stripe-connect

我正在努力创建支付,而运行代码我正在收到错误

Sorry, you don't have any external accounts in that currency (usd)

首先我创建了客户,然后我创建了银行帐户,之后我正在付款,任何人都可以帮助我如何解决这个问题,这是我的代码

<?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;


?>

1 个答案:

答案 0 :(得分:2)

您将银行帐户作为付款来源添加到customer object,即ACH payments

对于付款,如果这是您自己的Stripe帐户,则需要在https://dashboard.stripe.com/account/payouts的信息中心中输入您的银行帐户详细信息。如果您希望能够通过API创建付款,还需要将付款时间表设置为“手动”。

另请注意,在创建费用时,资金不会立即可用,因此您无法在创建费用后立即创建付款。您可以在https://stripe.com/docs/payouts

中阅读Stripe文档中有关付款的所有信息