From 5039307459bc9b9d3224cb15daaa9c9f4db52980 Mon Sep 17 00:00:00 2001 From: artur1214 <41078064+artur1214@users.noreply.github.com> Date: Wed, 8 May 2024 23:12:04 +0600 Subject: [PATCH] Fixed Astound\Affirm\Gateway\Validator\Client\PaymentActionsValidatorVoid class. (#132) Problem of class was simple: constructor, used there never called parent's constructor, so Depenedcy Injections of parent constructor was ingored. This lead to `$this->createResult(...` at 71 line, causing error, because it calls parent's `createResult` from `Magento\Payment\Gateway\Validator\AbstractValidator`, and it uses `$this->resultInterfaceFactory`, which is unexpeted null, because parent constuctor never set up this value, because of parent::__construc() was never called, and DI's values wass never passed there. Co-authored-by: artur vinogradov --- .../Validator/Client/PaymentActionsValidatorVoid.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Gateway/Validator/Client/PaymentActionsValidatorVoid.php b/Gateway/Validator/Client/PaymentActionsValidatorVoid.php index e862647..3744e6e 100644 --- a/Gateway/Validator/Client/PaymentActionsValidatorVoid.php +++ b/Gateway/Validator/Client/PaymentActionsValidatorVoid.php @@ -20,7 +20,9 @@ use Magento\Payment\Gateway\Helper\SubjectReader; use Astound\Affirm\Helper\ErrorTracker; - +use Astound\Affirm\Gateway\Helper\Util; +use Magento\Payment\Gateway\Validator\ResultInterface; +use Magento\Payment\Gateway\Validator\ResultInterfaceFactory; /** * Class PaymentActionsValidatorVoid */ @@ -42,10 +44,12 @@ class PaymentActionsValidatorVoid extends PaymentActionsValidator public $errorTracker; public function __construct( - \Astound\Affirm\Helper\ErrorTracker $errorTracker + ResultInterfaceFactory $resultFactory, + ErrorTracker $errorTracker, + Util $util ) { - $this->errorTracker = $errorTracker; + parent::__construct($resultFactory, $errorTracker, $util); } /**