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;
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
* @return \Magento\Payment\Gateway\Validator\ResultInterface
......@@ -40,7 +60,7 @@ class CancelResponseValidator extends AbstractValidator
if ($response['response'] != '[cancelOrRefund-received]') {
$errorMsg = __('Error with cancellation');
$this->_logger->critical($errorMsg);
$this->adyenLogger->error($errorMsg);
$errorMessages[] = $errorMsg;
}
......
......@@ -27,6 +27,26 @@ use Magento\Payment\Gateway\Validator\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
* @throws \Magento\Framework\Exception\LocalizedException
......@@ -40,7 +60,7 @@ class CaptureResponseValidator extends AbstractValidator
if ($response['response'] != '[capture-received]') {
$errorMsg = __('Error with capture');
$this->_logger->critical($errorMsg);
$this->adyenLogger->error($errorMsg);
$errorMessages[] = $errorMsg;
}
......
......@@ -28,20 +28,21 @@ use Magento\Payment\Gateway\Validator\AbstractValidator;
class GeneralResponseValidator extends AbstractValidator
{
/**
* @var Psr\Log\LoggerInterface
* @var \Adyen\Payment\Logger\AdyenLogger
*/
private $logger;
private $adyenLogger;
/**
* 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(
\Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory,
\Psr\Log\LoggerInterface $loggerInterface
\Adyen\Payment\Logger\AdyenLogger $adyenLogger
) {
$this->logger = $loggerInterface;
$this->adyenLogger = $adyenLogger;
parent::__construct($resultFactory);
}
......@@ -108,7 +109,7 @@ class GeneralResponseValidator extends AbstractValidator
} else {
$isValid = false;
$errorMsg = __('3D secure is not valid.');
$this->logger->error($errorMsg);;
$this->adyenLogger->error($errorMsg);;
$errorMessages[] = $errorMsg;
}
break;
......
......@@ -27,6 +27,26 @@ use Magento\Payment\Gateway\Validator\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
* @throws \Magento\Framework\Exception\LocalizedException
......@@ -41,7 +61,7 @@ class RefundResponseValidator extends AbstractValidator
foreach ($responses as $response) {
if ($response['response'] != '[refund-received]') {
$errorMsg = __('Error with refund');
$this->_logger->critical($errorMsg);
$this->adyenLogger->error($errorMsg);
$errorMessages[] = $errorMsg;
}
}
......
......@@ -25,7 +25,6 @@ namespace Adyen\Payment\Gateway\Validator;
use Magento\Payment\Gateway\Validator\AbstractValidator;
use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
use Magento\Payment\Gateway\ConfigInterface;
/**
* Class SepaValidator
......@@ -33,21 +32,6 @@ use Magento\Payment\Gateway\ConfigInterface;
*/
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
* @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