简体   繁体   中英

stripe create payout getting error “Sorry, you don't have any external accounts in that currency (usd)”

I am working on create payout, while run the code i am getting error

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

first i am creating the customer, and then i am creating the bank account, and after then i am doing the payout, can anyone please help me how can i resolve this issue, here is my code

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


?>

You're adding a bank account as a payment source to a customer object , ie for ACH payments .

For payouts, if this is your own Stripe account, you need to enter your bank account details in your dashboard at https://dashboard.stripe.com/account/payouts . You'll also need to set your payout schedule to "Manual" if you want to be able to create payouts via the API.

Also note that when creating charges, funds are not immediately available, so you will not be able to create a payout immediately after creating a charge. You can read all about payouts in Stripe's documentation at https://stripe.com/docs/payouts .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM