2

我在 laravel 应用程序中使用 stripe php sdk,卖家用户在银行详细信息中添加虚拟银行帐号和路由号码。现在卖家使用下面的条带转账 API 将他的条带余额支付到他们的银行账户中

function payout()
{
    Stripe::setApiKey($this->secret_key);
    $balance = Balance::retrieve();
    $balance = $balance->available[0]->amount;

    if ($balance == 0) {
        return true;
    }

    $transfer = Transfer::create([
        "amount" => $balance ,
        "currency" => 'gbp',
        "destination" => 'default_for_currency',
        "description" => config('app.name') . ' payout.'
    ]);

    if ($transfer->failure_code !== null) {
        throw new Exception($transfer->failure_message);
    }

    $transaction = new StripeTransfer();
    $transaction->user_id = $this->user_id;
    $transaction->stripe_id = $transfer->id;
    $transaction->amount = $balance;
    $transaction->save();

    return true;
}

但这给出了以下错误-

"No such destination: default_for_currency"

我在测试环境中使用它。愿此影响。请帮助提供好的解决方案。谢谢

4

1 回答 1

0

destination应该是有效的 Stripe 帐户 ID 。例如类似的东西"acct_1HKbBD2oxnBfnQ8N"

于 2020-11-29T05:48:32.847 回答