fix: avoid float rounding errors when comparing
This commit is contained in:
1 parent
d6f2681c61
commit
8646dfbf02
1 file changed
+1
-1
@@ -122,7 +122,7 @@ class Step3Controller extends AbstractController
|
|||||||
$promoGoodwillDiscount = round($inquiryResponse->getVoucherDiscountFromPrices(), 2);
|
$promoGoodwillDiscount = round($inquiryResponse->getVoucherDiscountFromPrices(), 2);
|
||||||
$expectedTotal = round($calculatedSubtotal - $promoGoodwillDiscount, 2);
|
$expectedTotal = round($calculatedSubtotal - $promoGoodwillDiscount, 2);
|
||||||
|
|
||||||
if ($apiTotal !== $expectedTotal) {
|
if ((int) round($apiTotal * 100) !== (int) round($expectedTotal * 100)) {
|
||||||
return $this->handleApiError(
|
return $this->handleApiError(
|
||||||
'Price mismatch detected - payload incomplete',
|
'Price mismatch detected - payload incomplete',
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in new issue
Block a user