Skip to content

Commit

Permalink
Better log + MsgVer before OrderDesc
Browse files Browse the repository at this point in the history
  • Loading branch information
magentix committed Oct 3, 2022
1 parent da645c0 commit 36bcad9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class Magentix_Axepta_Model_Axepta
'Response',
'UserData',
'Capture',
'MsgVer',
'OrderDesc',
'ReqID',
'Plain',
Expand Down Expand Up @@ -156,7 +157,6 @@ class Magentix_Axepta_Model_Axepta
'Type',
'Plain',
'Custom',
'MsgVer',
'billingAddress',
'shippingAddress',
'billToCustomer',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ public function webhookAction()
}
} catch (Exception $exception) {
Mage::log($exception->getMessage(), Zend_Log::ERR, Magentix_Axepta_Helper_Data::AXEPTA_LOG_FILE);
Mage::log($this->getGatewayRequest(), Zend_Log::ERR, Magentix_Axepta_Helper_Data::AXEPTA_LOG_FILE);
}
}

Expand Down Expand Up @@ -273,7 +272,6 @@ public function failureAction()
$this->__('Your payment has failed. Please try again or choose another payment method.')
);
Mage::log($exception->getMessage(), Zend_Log::ERR, Magentix_Axepta_Helper_Data::AXEPTA_LOG_FILE);
Mage::log($this->getGatewayRequest(), Zend_Log::ERR, Magentix_Axepta_Helper_Data::AXEPTA_LOG_FILE);
}

$this->_redirect('checkout/cart');
Expand Down Expand Up @@ -331,9 +329,9 @@ public function cancelAction()
*/
protected function getRequestedOrder()
{
try {
$axeptaPayment = $this->getAxeptaPayment();
$axeptaPayment = $this->getAxeptaPayment();

try {
$axeptaPayment->setSecretKey($this->getPaymentHelper()->getHMAC());
$axeptaPayment->setCryptKey($this->getPaymentHelper()->getCryptKey());
$axeptaPayment->setResponse($this->getGatewayRequest());
Expand All @@ -351,7 +349,15 @@ protected function getRequestedOrder()

return $order;
} catch (Exception $exception) {
Mage::log($exception->getMessage(), Zend_Log::ERR, Magentix_Axepta_Helper_Data::AXEPTA_LOG_FILE);
$logs = [
'Magentix_Axepta_PaymentController::getRequestedOrder',
$exception->getMessage(),
$this->getGatewayRequest(),
$axeptaPayment->getParams()
];
foreach ($logs as $message) {
Mage::log($message, Zend_Log::ERR, Magentix_Axepta_Helper_Data::AXEPTA_LOG_FILE);
}
}

return false;
Expand Down

0 comments on commit 36bcad9

Please sign in to comment.