Merge pull request #504 from woocommerce/PCP-505-dcc-orders-randomly-failing

Improve detection of click event handler
This commit is contained in:
Emili Castells 2022-02-22 17:40:24 +01:00 committed by GitHub
commit 17e1c76280
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View file

@ -1,6 +1,7 @@
*** Changelog ***
= 1.7.0 - TBD =
* Fix - DCC orders randomly failing #503
* Fix - Multi-currency broke #481
* Fix - Address information from PayPal shortcut flow not loaded #451
* Enhancement - Improve onboarding flow, allow no card processing #443

View file

@ -9,7 +9,6 @@ class CreditCardRenderer {
this.cardValid = false;
this.formValid = false;
this.currentHostedFieldsInstance = null;
this.formSubmissionSubscribed = false;
}
render(wrapper, contextConfig) {
@ -122,7 +121,7 @@ class CreditCardRenderer {
});
if (!this.formSubmissionSubscribed) {
if (document.querySelector(wrapper).getAttribute('data-ppcp-subscribed') !== true) {
document.querySelector(wrapper + ' button').addEventListener(
'click',
event => {
@ -130,7 +129,8 @@ class CreditCardRenderer {
this._submit(contextConfig);
}
);
this.formSubmissionSubscribed = true;
document.querySelector(wrapper).setAttribute('data-ppcp-subscribed', true);
}
});
@ -143,7 +143,7 @@ class CreditCardRenderer {
}
disableFields() {
if( this.currentHostedFieldsInstance) {
if (this.currentHostedFieldsInstance) {
this.currentHostedFieldsInstance.setAttribute({
field: 'number',
attribute: 'disabled'
@ -160,7 +160,7 @@ class CreditCardRenderer {
}
enableFields() {
if( this.currentHostedFieldsInstance) {
if (this.currentHostedFieldsInstance) {
this.currentHostedFieldsInstance.removeAttribute({
field: 'number',
attribute: 'disabled'

View file

@ -82,6 +82,7 @@ Follow the steps below to connect the plugin to your PayPal account:
== Changelog ==
= 1.7.0 =
* Fix - DCC orders randomly failing #503
* Fix - Multi-currency broke #481
* Fix - Address information from PayPal shortcut flow not loaded #451
* Enhancement - Improve onboarding flow, allow no card processing #443