编程语言
首页 > 编程语言> > php – 条带创建支付获取错误“抱歉,您没有该货币的任何外部帐户(usd)”

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

作者:互联网

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

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;


?>

解决方法:

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

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

另请注意,在创建费用时,资金不会立即可用,因此您无法在创建费用后立即创建付款.您可以在https://stripe.com/docs/payouts阅读Stripe文档中有关支付的所有信息.

标签:php,stripe-payments,stripe-connect
来源: https://codeday.me/bug/20190701/1347911.html