mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Merge pull request #504 from woocommerce/PCP-505-dcc-orders-randomly-failing
Improve detection of click event handler
This commit is contained in:
commit
17e1c76280
3 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue