We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit b80be0e1 authored by Rik ter Beek's avatar Rik ter Beek

Validator Logger fix

parent 1cbf1cee
...@@ -27,6 +27,26 @@ use Magento\Payment\Gateway\Validator\AbstractValidator; ...@@ -27,6 +27,26 @@ use Magento\Payment\Gateway\Validator\AbstractValidator;
class CancelResponseValidator extends AbstractValidator class CancelResponseValidator extends AbstractValidator
{ {
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
private $adyenLogger;
/**
* GeneralResponseValidator constructor.
*
* @param \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/
public function __construct(
\Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger
) {
$this->adyenLogger = $adyenLogger;
parent::__construct($resultFactory);
}
/** /**
* @param array $validationSubject * @param array $validationSubject
* @return \Magento\Payment\Gateway\Validator\ResultInterface * @return \Magento\Payment\Gateway\Validator\ResultInterface
...@@ -40,7 +60,7 @@ class CancelResponseValidator extends AbstractValidator ...@@ -40,7 +60,7 @@ class CancelResponseValidator extends AbstractValidator
if ($response['response'] != '[cancelOrRefund-received]') { if ($response['response'] != '[cancelOrRefund-received]') {
$errorMsg = __('Error with cancellation'); $errorMsg = __('Error with cancellation');
$this->_logger->critical($errorMsg); $this->adyenLogger->error($errorMsg);
$errorMessages[] = $errorMsg; $errorMessages[] = $errorMsg;
} }
......
...@@ -27,6 +27,26 @@ use Magento\Payment\Gateway\Validator\AbstractValidator; ...@@ -27,6 +27,26 @@ use Magento\Payment\Gateway\Validator\AbstractValidator;
class CaptureResponseValidator extends AbstractValidator class CaptureResponseValidator extends AbstractValidator
{ {
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
private $adyenLogger;
/**
* GeneralResponseValidator constructor.
*
* @param \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/
public function __construct(
\Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger
) {
$this->adyenLogger = $adyenLogger;
parent::__construct($resultFactory);
}
/** /**
* @param array $validationSubject * @param array $validationSubject
* @throws \Magento\Framework\Exception\LocalizedException * @throws \Magento\Framework\Exception\LocalizedException
...@@ -40,7 +60,7 @@ class CaptureResponseValidator extends AbstractValidator ...@@ -40,7 +60,7 @@ class CaptureResponseValidator extends AbstractValidator
if ($response['response'] != '[capture-received]') { if ($response['response'] != '[capture-received]') {
$errorMsg = __('Error with capture'); $errorMsg = __('Error with capture');
$this->_logger->critical($errorMsg); $this->adyenLogger->error($errorMsg);
$errorMessages[] = $errorMsg; $errorMessages[] = $errorMsg;
} }
......
...@@ -28,20 +28,21 @@ use Magento\Payment\Gateway\Validator\AbstractValidator; ...@@ -28,20 +28,21 @@ use Magento\Payment\Gateway\Validator\AbstractValidator;
class GeneralResponseValidator extends AbstractValidator class GeneralResponseValidator extends AbstractValidator
{ {
/** /**
* @var Psr\Log\LoggerInterface * @var \Adyen\Payment\Logger\AdyenLogger
*/ */
private $logger; private $adyenLogger;
/** /**
* GeneralResponseValidator constructor. * GeneralResponseValidator constructor.
* @param ResultInterfaceFactory $resultFactory *
* @param \Psr\Log\LoggerInterface $loggerInterface * @param \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/ */
public function __construct( public function __construct(
\Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory, \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory,
\Psr\Log\LoggerInterface $loggerInterface \Adyen\Payment\Logger\AdyenLogger $adyenLogger
) { ) {
$this->logger = $loggerInterface; $this->adyenLogger = $adyenLogger;
parent::__construct($resultFactory); parent::__construct($resultFactory);
} }
...@@ -108,7 +109,7 @@ class GeneralResponseValidator extends AbstractValidator ...@@ -108,7 +109,7 @@ class GeneralResponseValidator extends AbstractValidator
} else { } else {
$isValid = false; $isValid = false;
$errorMsg = __('3D secure is not valid.'); $errorMsg = __('3D secure is not valid.');
$this->logger->error($errorMsg);; $this->adyenLogger->error($errorMsg);;
$errorMessages[] = $errorMsg; $errorMessages[] = $errorMsg;
} }
break; break;
......
...@@ -27,6 +27,26 @@ use Magento\Payment\Gateway\Validator\AbstractValidator; ...@@ -27,6 +27,26 @@ use Magento\Payment\Gateway\Validator\AbstractValidator;
class RefundResponseValidator extends AbstractValidator class RefundResponseValidator extends AbstractValidator
{ {
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
private $adyenLogger;
/**
* GeneralResponseValidator constructor.
*
* @param \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/
public function __construct(
\Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger
) {
$this->adyenLogger = $adyenLogger;
parent::__construct($resultFactory);
}
/** /**
* @param array $validationSubject * @param array $validationSubject
* @throws \Magento\Framework\Exception\LocalizedException * @throws \Magento\Framework\Exception\LocalizedException
...@@ -41,7 +61,7 @@ class RefundResponseValidator extends AbstractValidator ...@@ -41,7 +61,7 @@ class RefundResponseValidator extends AbstractValidator
foreach ($responses as $response) { foreach ($responses as $response) {
if ($response['response'] != '[refund-received]') { if ($response['response'] != '[refund-received]') {
$errorMsg = __('Error with refund'); $errorMsg = __('Error with refund');
$this->_logger->critical($errorMsg); $this->adyenLogger->error($errorMsg);
$errorMessages[] = $errorMsg; $errorMessages[] = $errorMsg;
} }
} }
......
...@@ -25,7 +25,6 @@ namespace Adyen\Payment\Gateway\Validator; ...@@ -25,7 +25,6 @@ namespace Adyen\Payment\Gateway\Validator;
use Magento\Payment\Gateway\Validator\AbstractValidator; use Magento\Payment\Gateway\Validator\AbstractValidator;
use Magento\Payment\Gateway\Validator\ResultInterfaceFactory; use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
use Magento\Payment\Gateway\ConfigInterface;
/** /**
* Class SepaValidator * Class SepaValidator
...@@ -33,21 +32,6 @@ use Magento\Payment\Gateway\ConfigInterface; ...@@ -33,21 +32,6 @@ use Magento\Payment\Gateway\ConfigInterface;
*/ */
class SepaValidator extends AbstractValidator class SepaValidator extends AbstractValidator
{ {
/**
* @var \Magento\Payment\Gateway\ConfigInterface
*/
private $config;
/**
* @param ResultInterfaceFactory $resultFactory
* @param \Magento\Payment\Gateway\ConfigInterface $config
*/
public function __construct(
ResultInterfaceFactory $resultFactory
) {
parent::__construct($resultFactory);
}
/** /**
* @param array $validationSubject * @param array $validationSubject
* @return \Magento\Payment\Gateway\Validator\ResultInterface * @return \Magento\Payment\Gateway\Validator\ResultInterface
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment