update: fix switch payment handling fee calc

This commit is contained in:
v2board 2023-04-23 14:40:21 +08:00
parent d8aace8647
commit 1e6210290b

View File

@ -191,6 +191,7 @@ class OrderController extends Controller
$payment = Payment::find($method); $payment = Payment::find($method);
if (!$payment || $payment->enable !== 1) abort(500, __('Payment method is not available')); if (!$payment || $payment->enable !== 1) abort(500, __('Payment method is not available'));
$paymentService = new PaymentService($payment->payment, $payment->id); $paymentService = new PaymentService($payment->payment, $payment->id);
$order->handling_amount = NULL;
if ($payment->handling_fee_fixed || $payment->handling_fee_percent) { if ($payment->handling_fee_fixed || $payment->handling_fee_percent) {
$order->handling_amount = round(($order->total_amount * ($payment->handling_fee_percent / 100)) + $payment->handling_fee_fixed); $order->handling_amount = round(($order->total_amount * ($payment->handling_fee_percent / 100)) + $payment->handling_fee_fixed);
} }