Skip to content

Commit

Permalink
fix: admin 3ds status in order page and e-mail in tdsdata
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiano-mallmann authored Jan 5, 2024
2 parents 584dd3c + d091686 commit 2220b36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Block/Payment/Info/CreditCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ?? ''
);
}

Expand Down
3 changes: 2 additions & 1 deletion Block/Payment/Info/Debit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ?? ''
);
}
}
12 changes: 8 additions & 4 deletions view/frontend/web/js/core/checkout/Tds.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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',
Expand All @@ -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,
Expand Down

0 comments on commit 2220b36

Please sign in to comment.