update: checkout round

This commit is contained in:
tokumeikoi 2022-05-06 16:54:25 +08:00
parent 5bd811e217
commit 8311722fda

View File

@ -185,7 +185,7 @@ class OrderController extends Controller
if (!$payment || $payment->enable !== 1) abort(500, __('Payment method is not available'));
$paymentService = new PaymentService($payment->payment, $payment->id);
if ($payment->handling_fee_fixed || $payment->handling_fee_percent) {
$order->handling_amount = ($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);
}
$order->payment_id = $method;
if (!$order->save()) abort(500, __('Request failed, please try again later'));