我在laravel应用程序中使用条纹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"
我正在测试环境中使用它。可能会影响。请帮助提供良好的解决方案。谢谢
答案 0 :(得分:0)
$regexp = '/"(\s*)\:(\s*)(\-?\d+([eE][\+|\-]?\d+|\.\d+)+)(\s*[,(\s*)|\}])/';
$json_string = preg_replace($regexp, "$1:$2\"$3\"$5", $json);
应该是有效的Stripe帐户ID。例如类似于destination