Skip to content

Commit

Permalink
Merge pull request #66 from Affirm/hotfix-update-logging
Browse files Browse the repository at this point in the history
Hotfix update logging
  • Loading branch information
taehyunlim authored Aug 13, 2021
2 parents 50f5757 + 2dc2619 commit 3d9fab4
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 37 deletions.
13 changes: 0 additions & 13 deletions Gateway/Validator/Client/PaymentActionsValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,12 @@

use Magento\Payment\Gateway\Helper\SubjectReader;
use Astound\Affirm\Gateway\Helper\Util;
use Astound\Affirm\Logger\Logger;

/**
* Class PaymentActionsValidator
*/
class PaymentActionsValidator extends AbstractResponseValidator
{
/**
* Constructor
*
* @param Logger $logger
*/
public function __construct(
Logger $logger
) {
$this->logger = $logger;
}

/**
* @inheritdoc
*/
Expand All @@ -56,7 +44,6 @@ public function validate(array $validationSubject)
[__('Affirm error code:') . $response[self::RESPONSE_CODE] . __(' error: ') .
__($response[self::ERROR_MESSAGE])]:
[__('Transaction has been declined, please, try again later.')];
$this->logger->debug('Astound\Affirm\Gateway\Validator\Client\PaymentActionsValidator::validate', $errorMessages);
}

return $this->createResult($validationResult, $errorMessages);
Expand Down
13 changes: 0 additions & 13 deletions Gateway/Validator/Client/PaymentActionsValidatorVoid.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
namespace Astound\Affirm\Gateway\Validator\Client;

use Magento\Payment\Gateway\Helper\SubjectReader;
use Astound\Affirm\Logger\Logger;

/**
* Class PaymentActionsValidatorVoid
Expand All @@ -33,17 +32,6 @@ class PaymentActionsValidatorVoid extends PaymentActionsValidator
const RESPONSE_TYPE_VOID = 'void';
/**#@-*/

/**
* Constructor
*
* @param Logger $logger
*/
public function __construct(
Logger $logger
) {
$this->logger = $logger;
}

/**
* @inheritdoc
*/
Expand All @@ -57,7 +45,6 @@ public function validate(array $validationSubject)

if (!$validationResult) {
$errorMessages = [__('Transaction has been declined, please, try again later.')];
$this->logger->debug('Astound\Affirm\Gateway\Validator\Client\PaymentActionsValidatorVoid::validate', $errorMessages);
}

return $this->createResult($validationResult, $errorMessages);
Expand Down
10 changes: 1 addition & 9 deletions Gateway/Validator/CurrencyValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Magento\Payment\Gateway\Validator\ResultInterface;
use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
use Magento\Payment\Gateway\Validator\AbstractValidator;
use Astound\Affirm\Logger\Logger;

/**
* Class CurrencyValidator
Expand All @@ -43,15 +42,12 @@ class CurrencyValidator extends AbstractValidator
*
* @param ResultInterfaceFactory $resultFactory
* @param \Magento\Payment\Gateway\ConfigInterface $config
* @param Logger $logger
*/
public function __construct(
ResultInterfaceFactory $resultFactory,
ConfigInterface $config,
Logger $logger
ConfigInterface $config
) {
$this->config = $config;
$this->logger = $logger;
parent::__construct($resultFactory);
}

Expand All @@ -63,7 +59,6 @@ public function __construct(
*/
public function validate(array $validationSubject)
{
$log = [];
$isValid = true;
$storeId = $validationSubject['storeId'];
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
Expand All @@ -77,9 +72,6 @@ public function validate(array $validationSubject)

if (!in_array($currentCurrencyCode, $availableCurrencies)) {
$isValid = false;
$log['code'] = $currentCurrencyCode;
$log['availableCurrencies'] = $availableCurrencies;
$this->logger->debug('Astound\Affirm\Gateway\Validator\CurrencyValidator::validate', $log);
}
}
return $this->createResult($isValid);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "affirm/magento2",
"description": "Affirm's extension for the Magento 2 https://www.affirm.com/",
"type": "magento2-module",
"version": "3.0.12",
"version": "3.0.13",
"license": [
"BSD-3-Clause"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Astound_Affirm" setup_version="3.0.12">
<module name="Astound_Affirm" setup_version="3.0.13">
<sequence>
<module name="Magento_Checkout"/>
<module name="Magento_Sales"/>
Expand Down

0 comments on commit 3d9fab4

Please sign in to comment.