Skip to content

Commit

Permalink
Updated logging
Browse files Browse the repository at this point in the history
  • Loading branch information
woutse committed Jul 8, 2022
1 parent 01960ce commit fae9992
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Controller/Checkout/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,10 @@ private function processPaidOrder(Transaction $transaction, Order $order)
$orderAmount = round($order->getGrandTotal(), 2);
$orderBaseAmount = round($order->getBaseGrandTotal(), 2);
if (!in_array($orderAmount, $transactionPaid) && !in_array($orderBaseAmount, $transactionPaid)) {
payHelper::logCritical('Amount validation error.', array($transactionPaid, $orderAmount, $order->getGrandTotal()));
return $this->result->setContents('FALSE| Amount validation error. Amounts: ' . print_r(array($transactionPaid, $orderAmount, $order->getGrandTotal()), true));
payHelper::logCritical('Amount validation error.', array($transactionPaid, $orderAmount, $order->getGrandTotal(), $order->getBaseGrandTotal()));
return $this->result->setContents('FALSE| Amount validation error. Amounts: ' . print_r(array($transactionPaid, $orderAmount, $order->getGrandTotal(), $order->getBaseGrandTotal()), true));
}

$paidAmount = $order->getBaseGrandTotal();

# Force order state to processing
$order->setState(Order::STATE_PROCESSING);
$paymentMethod = $order->getPayment()->getMethod();
Expand Down Expand Up @@ -332,9 +330,9 @@ private function processPaidOrder(Transaction $transaction, Order $order)
}

if ($transaction->isAuthorized()) {
$payment->registerAuthorizationNotification($paidAmount);
$payment->registerAuthorizationNotification($order->getBaseGrandTotal());
} else {
$payment->registerCaptureNotification($paidAmount, $this->config->isSkipFraudDetection());
$payment->registerCaptureNotification($order->getBaseGrandTotal(), $this->config->isSkipFraudDetection());
}

$order->setStatus(!empty($newStatus) ? $newStatus : Order::STATE_PROCESSING);
Expand Down

0 comments on commit fae9992

Please sign in to comment.