Skip to content

Commit 24479b3

Browse files
author
Mercado Pago
committed
Release v8.4.7
1 parent a947e78 commit 24479b3

File tree

86 files changed

+2247
-2026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2247
-2026
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [8.4.7] - 2025-09-08
9+
### Fixed
10+
- Adopting code style fixes according to QIT (Quality Insights Toolkit)
11+
- Fixed visual conflict in checkout screen image styles
12+
- Fix to check access to fast payments flow when email is updated
13+
- Optimizing the fast payment flow during trigger
14+
815
## [8.4.6] - 2025-08-25
916
### Fixed
1017
- Text and translation corrections in the fast payments flow

assets/css/checkouts/mp-plugins-components.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/checkouts/super-token/entities/super-token-authenticator.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ class MPSuperTokenAuthenticator {
2121
this.mpSuperTokenMetrics = mpSuperTokenMetrics;
2222
}
2323

24+
reset() {
25+
this.ableToUseSuperToken = null;
26+
}
27+
2428
getAmountUsed() {
2529
return this.amountUsed;
2630
}

assets/js/checkouts/super-token/entities/super-token-authenticator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/checkouts/super-token/entities/super-token-payment-methods.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class MPSuperTokenPaymentMethods {
1010
CHECKOUT_CUSTOM_CONTAINER_SELECTOR = '.mp-checkout-custom-container';
1111
CHECKOUT_CONTAINER_SELECTOR = '.mp-checkout-container';
1212
CHECKOUT_TYPE_SELECTOR = '#mp_checkout_type';
13-
CLICKABLE_AREA_STARTS_ID = 'mp-super-token-clickable-area';
1413
COLOMBIA_ACCRONYM = 'MCO';
1514
MEXICO_ACCRONYM = 'MLM';
1615
SUPER_TOKEN_STYLES = {
@@ -124,15 +123,6 @@ class MPSuperTokenPaymentMethods {
124123
return !!document.querySelector(`.${this.SUPER_TOKEN_STYLES.PAYMENT_METHOD}`);
125124
}
126125

127-
removeClickableAreas() {
128-
const clickableAreas = document.querySelectorAll(`[id^=${this.CLICKABLE_AREA_STARTS_ID}]`);
129-
130-
clickableAreas.forEach((clickableArea) => {
131-
clickableArea.firstChild.style.pointerEvents = 'auto';
132-
clickableArea.replaceWith(clickableArea.firstChild);
133-
});
134-
}
135-
136126
async getAccountPaymentMethods(token) {
137127
this.setSuperToken(token);
138128

@@ -311,7 +301,7 @@ class MPSuperTokenPaymentMethods {
311301
return;
312302
}
313303

314-
this.removeClickableAreas();
304+
window.mpSuperTokenTriggerHandler?.removeClickableAreas();
315305
this.storeActivePaymentMethod({ id: this.NEW_CARD_TYPE });
316306
this.deselectAllPaymentMethods();
317307
this.hideAllPaymentMethodDetails();

assets/js/checkouts/super-token/entities/super-token-payment-methods.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/checkouts/super-token/entities/super-token-trigger-handler.js

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MPSuperTokenTriggerHandler {
55
CUSTOM_CHECKOUT_CLASSIC_RADIO_SELECTOR = '#payment_method_woo-mercado-pago-custom';
66
CUSTOM_CHECKOUT_CLASSIC_SELECTOR = '.payment_method_woo-mercado-pago-custom';
77
CUSTOM_CHECKOUT_CONTAINER_ID = 'mp-custom-checkout-form-container';
8-
CLICKABLE_AREA_STARTS_ID = 'mp-super-token-clickable-area';
8+
CLICKABLE_AREA_CLASS = 'mp-super-token-clickable-area';
99
CARD_NUMBER_FIELD_ID = 'form-checkout__cardNumber-container';
1010
CARD_HOLDER_NAME_FIELD_ID = 'form-checkout__cardholderName';
1111
EXPIRATION_DATE_FIELD_ID = 'form-checkout__expirationDate-container';
@@ -95,7 +95,7 @@ class MPSuperTokenTriggerHandler {
9595
}
9696

9797
alreadyHasClickableArea() {
98-
return !!document.querySelector(`[id^=${this.CLICKABLE_AREA_STARTS_ID}]`);
98+
return !!document.querySelector(`.${this.CLICKABLE_AREA_CLASS}`);
9999
}
100100

101101
shouldCreateClickableArea() {
@@ -116,33 +116,29 @@ class MPSuperTokenTriggerHandler {
116116
}
117117

118118
createClickableArea(element) {
119-
const clickableArea = document.createElement('div');
119+
const clickableArea = element.parentElement;
120120

121-
clickableArea.id = this.CLICKABLE_AREA_STARTS_ID + element.id;
122121
clickableArea.addEventListener('click', this.onTrigger.bind(this), { once: true });
122+
clickableArea.classList.add(this.CLICKABLE_AREA_CLASS);
123123

124124
element.style.pointerEvents = 'none';
125-
126-
if (element.id.includes('holderName')) {
127-
element.style.width = '100%';
128-
element.style.boxSizing = 'border-box !important';
129-
}
130-
131-
element.parentNode.replaceChild(clickableArea, element);
132-
clickableArea.appendChild(element);
125+
element.classList.add('mp-pointer-events-none');
133126
}
134127

135128
removeClickableAreas() {
136-
const clickableAreas = document.querySelectorAll(`[id^=${this.CLICKABLE_AREA_STARTS_ID}]`);
129+
const clickableAreas = document.querySelectorAll(`.${this.CLICKABLE_AREA_CLASS}`);
137130

138131
clickableAreas.forEach((clickableArea) => {
139-
clickableArea.firstChild.style.pointerEvents = 'auto';
140-
clickableArea.replaceWith(clickableArea.firstChild);
132+
const input = clickableArea.querySelector('.mp-pointer-events-none');
133+
input.style.pointerEvents = 'auto';
134+
input.classList.remove('mp-pointer-events-none');
135+
clickableArea.classList.remove(this.CLICKABLE_AREA_CLASS);
136+
clickableArea.removeEventListener('click', this.onTrigger.bind(this));
141137
});
142138
}
143139

144140
onTrigger() {
145-
if (this.isAuthenticating) {
141+
if (this.isAuthenticating || !this.alreadyHasClickableArea()) {
146142
return;
147143
}
148144

@@ -164,6 +160,7 @@ class MPSuperTokenTriggerHandler {
164160

165161
resetFlow() {
166162
this.reset();
163+
this.mpSuperTokenAuthenticator.reset();
167164
this.mpSuperTokenPaymentMethods.reset();
168165
}
169166

@@ -214,20 +211,20 @@ class MPSuperTokenTriggerHandler {
214211

215212
if (!this.isAlreadyListeningForm) {
216213
this.wcEmailListener.onEmailChange(async (email, isValid) => {
217-
if (this.isDifferentEmail(email) && this.wcBuyerEmail != null) {
218-
this.wcBuyerEmail = email;
219-
this.resetCustomCheckout();
214+
if (!isValid || !currentAmount) {
220215
return;
221216
}
222217

218+
if (this.isDifferentEmail(email) && this.wcBuyerEmail != null) {
219+
this.resetCustomCheckout();
220+
}
221+
223222
this.wcBuyerEmail = email;
224223

225-
if (isValid && currentAmount) {
226-
const canUseSuperToken = await this.mpSuperTokenAuthenticator.canUseSuperTokenFlow(currentAmount, email);
224+
const canUseSuperToken = await this.mpSuperTokenAuthenticator.canUseSuperTokenFlow(currentAmount, email);
227225

228-
if (!canUseSuperToken) {
229-
this.removeClickableAreas();
230-
}
226+
if (!canUseSuperToken) {
227+
this.removeClickableAreas();
231228
}
232229
});
233230

assets/js/checkouts/super-token/entities/super-token-trigger-handler.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)