platform orders: bmpa receipt mismatch safety valve uses configured tolerance
This commit is contained in:
@@ -1240,7 +1240,11 @@ class PlatformOrderController extends Controller
|
||||
$receiptCents = (int) round($receiptTotal * 100);
|
||||
$expectedCents = (int) round($expectedPaid * 100);
|
||||
|
||||
if (abs($receiptCents - $expectedCents) >= 1) {
|
||||
$tol = (float) config('saasshop.amounts.tolerance', 0.01);
|
||||
$tolCents = (int) round($tol * 100);
|
||||
$tolCents = max(1, $tolCents);
|
||||
|
||||
if (abs($receiptCents - $expectedCents) >= $tolCents) {
|
||||
throw new \InvalidArgumentException('订单回执总额与应付金额不一致,不允许批量推进,请先修正回执/金额后再处理。');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user