我正在尝试将Stripe集成到我的Laravel应用程序中 . 我正在尝试使用条纹的this(付卡)服务 .
我从Stripe重定向后使用下面的代码
try {
$charge = Charge::create([
'amount' => $price * 100,
'currency' => 'gbp',
'source' => $request->stripeToken,
'application_fee' => 123, // Here is the issue , if I remove this line it works fine.
], [
'stripe_account' => $stripe_id,
]);
} catch (Exception $e) {
return back()->withError('Something went wrong while processing your payment.');
}
我收到了以下错误
UPDATE
现在我使用下面的代码 .
try {
$charge = Charge::create([
'amount' => $price * 100,
'currency' => 'gbp',
'source' => $request->stripeToken,
"destination" => array(
"amount" => 877,
"account" => "ca_CxKfJvDzUYe3NUpOYZcRofjlZzE8OYCq",
),
], [
'stripe_account' => $stripe_id,
]);
} catch (Exception $e) {
return back()->withError('Something went wrong while processing your payment.');
}
我收到了以下错误
1 回答
这可能对你有所帮助 . 这对我来说很好 . 首先创建客户并获得客户ID并收取费用这是一步 . 任何其他问题..然后在这里ping