From 86f41653b829f011fe5607a7d59e6a973f19ef67 Mon Sep 17 00:00:00 2001 From: "Nicolas D." <50154923+nicolasddev@users.noreply.github.com> Date: Tue, 15 Jul 2025 00:20:37 -0400 Subject: [PATCH] Update PaymentActionsValidator.php An error was encountered when attempting to invoice an order paid through Affirm. The error was encountered when attempting to log the error message, specifically when the $validationResult variable was set to false, indicating that the response could not be validated. Since the translation has already been rendered, the $errorMessages[0] variable is of type string and the \Magento\Framework\Phrase::render() function cannot be used. --- Gateway/Validator/Client/PaymentActionsValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gateway/Validator/Client/PaymentActionsValidator.php b/Gateway/Validator/Client/PaymentActionsValidator.php index bfa1c22..1eeccbc 100644 --- a/Gateway/Validator/Client/PaymentActionsValidator.php +++ b/Gateway/Validator/Client/PaymentActionsValidator.php @@ -112,7 +112,7 @@ public function validate(array $validationSubject) $this->errorTracker->logErrorToAffirm( transaction_step: $transaction_step, error_type: ErrorTracker::TRANSACTION_DECLINED, - error_message: $errorMessages[0]->render() + error_message: $errorMessages[0] ); throw new \Magento\Framework\Validator\Exception(__($errorMessages[0])); @@ -120,4 +120,4 @@ public function validate(array $validationSubject) return $this->createResult($validationResult, $errorMessages); } -} \ No newline at end of file +}