Skip to content

Commit ddee122

Browse files
authored
Merge pull request #166 from paynl/feature/PLUG-4512
PLUG-4512 - Small decimal fix
2 parents 1ee2af1 + e946dca commit ddee122

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

includes/classes/PPMFWC/Helper/Transaction.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@ public static function processTransaction($transactionId, $status = null, $metho
244244
case PPMFWC_Gateways::STATUS_AUTHORIZE:
245245
case PPMFWC_Gateways::STATUS_SUCCESS:
246246
# Check the amount
247-
if (!in_array($order->get_total(), $transactionPaid)) {
248-
$order->update_status('on-hold', sprintf(__("Validation error: Paid amount does not match order amount. \npaidAmount: %s, \norderAmount: %s\n", PPMFWC_WOOCOMMERCE_TEXTDOMAIN), implode(' / ', $transactionPaid), $order->get_total())); // phpcs:ignore
247+
$roundTotal = round($order->get_total(), 2);
248+
if (!in_array($roundTotal, $transactionPaid)) {
249+
$order->update_status('on-hold', sprintf(__("Validation error: Paid amount does not match order amount. \npaidAmount: %s, \norderAmount: %s\n", PPMFWC_WOOCOMMERCE_TEXTDOMAIN), implode(' / ', $transactionPaid), $roundTotal)); // phpcs:ignore
249250
} else {
250251

251252
if (PPMFWC_Hooks_FastCheckout_Exchange::isPaymentBasedCheckout($params)) {

0 commit comments

Comments
 (0)