Dispatch hosted fields loaded event

This commit is contained in:
dinamiko 2021-09-14 11:24:27 +02:00
parent ab32a20f68
commit da7450ccdf
2 changed files with 3 additions and 2 deletions

View file

@ -24,11 +24,11 @@ class CheckoutBootstap {
})
setTimeout(() => {
jQuery(document).on('hosted_fields_loaded', () => {
jQuery('#saved-credit-card').on('change', () => {
this.displayPlaceOrderButtonForSavedCreditCards()
})
}, 3000)
});
this.switchBetweenPayPalandOrderButton()
this.displayPlaceOrderButtonForSavedCreditCards()

View file

@ -100,6 +100,7 @@ class CreditCardRenderer {
}
}
}).then(hostedFields => {
document.dispatchEvent(new CustomEvent("hosted_fields_loaded"));
this.currentHostedFieldsInstance = hostedFields;
hostedFields.on('inputSubmitRequest', () => {