Ошибка выплаты Stripe Uncaught Stripe \ Error \ InvalidRequest: Извините, у вас нет внешних счетов в этой валюте (usd) - PullRequest
0 голосов
/ 09 января 2020

Ниже приведен мой код выплаты Stripe. Когда я запускаю этот код, я получаю следующую ошибку:

Неустранимая ошибка: Uncaught Stripe \ Error \ InvalidRequest: Извините, у вас нет внешних счетов в этой валюте (usd). в E: \ xammp- php -7.0 \ htdocs \ grumbledog_web \ app \ vendors \ stripe-php \ lib \ ApiRequestor. php: 210 из запроса API 'req_r9TZvcfX1ac6Az' Трассировка стека: # 0 E: \ xammp- php -7.0 \ htdocs \ grumbledog_web \ app \ vendors \ stripe-php \ lib \ ApiRequestor. php (173): Stripe \ ApiRequestor :: _ specificAPIError ('{\ n "error": {\ n ...' , 400, Object (Stripe \ Util \ CaseInsensitiveArray), Array, Array) # 1 E: \ xammp- php -7.0 \ htdocs \ grumbledog_web \ app \ vendors \ stripe-php \ lib \ ApiRequestor. php (473 ): Stripe \ ApiRequestor-> handleErrorResponse ('{\ n "error": {\ n ...', 400, Object (Stripe \ Util \ CaseInsensitiveArray), Array) # 2 E: \ xammp- php -7.0 \ htdocs \ grumbledog_web \ app \ vendors \ stripe-php \ lib \ ApiRequestor. php (126): Stripe \ ApiRequestor -> _ interpretResponse ('{\ n "error": {\ n ...', 400, Object (Stripe \ Util \ CaseInsensitiveArray)) # 3 E: \ xammp- php -7.0 \ htdocs \ grumbledog_web \ app \ vendors \ stripe-php \ lib \ ApiOperations \ Request. php (57): Stripe \ ApiRequestor- > request ('post', '/ v1 / payou в E: \ xammp- php -7.0 \ htdocs \ grumbledog_web \ app \ vendo rs \ stripe-php \ lib \ ApiRequestor. php в строке 210

Мой код:

public function payout() {
    require_once('vendors/stripe-php/init.php');
    $stripe = array(
        "secret_key" => cr("DealConfig.secret_key"),
        "publishable_key" => cr("DealConfig.publishable_key")
    );
    \Stripe\Stripe::setApiKey($stripe['secret_key']);
    $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 = \Stripe\Customer::createSource(
                    $customer_id, ['source' => $bank_token]
    );
    $payout_data = \Stripe\Payout::create(array(
                "amount" => 1000,
                "currency" => "usd",
    ));
    echo "<pre>";
    print_r($payout_data);
    die;
}
...