From d0916866da534c0bbfb6035a36584520d28e36f5 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Tue, 19 Dec 2023 16:47:42 -0300 Subject: [PATCH] fix: admin 3ds status in order page and e-mail in tdsdata --- Block/Payment/Info/CreditCard.php | 3 ++- Block/Payment/Info/Debit.php | 3 ++- view/frontend/web/js/core/checkout/Tds.js | 12 ++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Block/Payment/Info/CreditCard.php b/Block/Payment/Info/CreditCard.php index 27ab113a..40d6cdc8 100644 --- a/Block/Payment/Info/CreditCard.php +++ b/Block/Payment/Info/CreditCard.php @@ -76,8 +76,9 @@ public function getInstallments() public function getThreeDSStatus() { + $authentication = json_decode($this->getInfo()->getAdditionalInformation('authentication'), true); return AuthenticationStatusEnum::statusMessage( - $this->getInfo()->getAdditionalInformation('authentication')['trans_status'] ?? '' + $authentication['trans_status'] ?? '' ); } diff --git a/Block/Payment/Info/Debit.php b/Block/Payment/Info/Debit.php index c7ad77d1..cd0cad58 100644 --- a/Block/Payment/Info/Debit.php +++ b/Block/Payment/Info/Debit.php @@ -43,8 +43,9 @@ public function getTitle() public function getThreeDSStatus() { + $authentication = json_decode($this->getInfo()->getAdditionalInformation('authentication'), true); return AuthenticationStatusEnum::statusMessage( - $this->getInfo()->getAdditionalInformation('authentication')['trans_status'] ?? '' + $authentication['trans_status'] ?? '' ); } } diff --git a/view/frontend/web/js/core/checkout/Tds.js b/view/frontend/web/js/core/checkout/Tds.js index fdd659c1..5a7b79c6 100644 --- a/view/frontend/web/js/core/checkout/Tds.js +++ b/view/frontend/web/js/core/checkout/Tds.js @@ -54,7 +54,7 @@ define([ cardForm.creditCardExpYear.attr("data-pagarmecheckout-element", "exp_year") cardForm.creditCardCvv.attr("data-pagarmecheckout-element", "cvv") } - + removeTdsAttributeData() { const cardForm = this.formObject; jQuery(cardForm.containerSelector).removeAttr("data-pagarmecheckout-form") @@ -81,7 +81,11 @@ define([ shippingAddressComplement ] = shippingAddress.street; - const customerData = window.checkoutConfig.customerData; + let customerEmail = window.checkoutConfig.customerData?.email; + if(quote.guestEmail) { + customerEmail = quote.guestEmail + } + const customerPhones = [{ country_code : '55', @@ -108,12 +112,12 @@ define([ country : 'BRA', post_code : shippingAddress.postcode }, - email : customerData.email, + email : customerEmail, phones : customerPhones, card_expiry_date : cardExpiryDate, purchase : { amount : quote.totals().grand_total * 100, - date : + date : new Date().toISOString() , instal_data : 2,