From 1dcf8641bd988f5eb47fef09e17483b867935fce Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Thu, 11 Jan 2024 13:56:34 -0300 Subject: [PATCH] fix: json_decode for non 3ds order in admin --- Block/Payment/Info/CreditCard.php | 7 ++++++- Block/Payment/Info/Debit.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Block/Payment/Info/CreditCard.php b/Block/Payment/Info/CreditCard.php index 40d6cdc8..8a79027e 100644 --- a/Block/Payment/Info/CreditCard.php +++ b/Block/Payment/Info/CreditCard.php @@ -76,7 +76,12 @@ public function getInstallments() public function getThreeDSStatus() { - $authentication = json_decode($this->getInfo()->getAdditionalInformation('authentication'), true); + $authenticationAdditionalInformation = $this->getInfo()->getAdditionalInformation('authentication'); + if (empty($authenticationAdditionalInformation)) { + return ''; + } + + $authentication = json_decode($authenticationAdditionalInformation, true); return AuthenticationStatusEnum::statusMessage( $authentication['trans_status'] ?? '' ); diff --git a/Block/Payment/Info/Debit.php b/Block/Payment/Info/Debit.php index cd0cad58..a78bda0e 100644 --- a/Block/Payment/Info/Debit.php +++ b/Block/Payment/Info/Debit.php @@ -43,7 +43,12 @@ public function getTitle() public function getThreeDSStatus() { - $authentication = json_decode($this->getInfo()->getAdditionalInformation('authentication'), true); + $authenticationAdditionalInformation = $this->getInfo()->getAdditionalInformation('authentication'); + if (empty($authenticationAdditionalInformation)) { + return ''; + } + + $authentication = json_decode($authenticationAdditionalInformation, true); return AuthenticationStatusEnum::statusMessage( $authentication['trans_status'] ?? '' );