Eway: Add loaders (#91)

* eway: add loaders

* assets build
This commit is contained in:
Benjamin Beganović 2024-08-30 01:17:09 +02:00
parent 414cfca1af
commit c341dfd3cd
3 changed files with 12 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -99,7 +99,7 @@
"src": "resources/js/clients/payments/checkout-credit-card.js"
},
"resources/js/clients/payments/eway-credit-card.js": {
"file": "assets/eway-credit-card-0119725d.js",
"file": "assets/eway-credit-card-150298fa.js",
"imports": [
"_wait-8f4ae121.js"
],

View File

@ -433,6 +433,11 @@ class EwayRapid {
completeAuthorization(event) {
event.target.parentElement.disabled = true;
const button = document.getElementById('authorize-card');
button.querySelector('svg').classList.remove('hidden');
button.querySelector('span').classList.add('hidden');
document.getElementById('server-response').submit();
}
@ -500,9 +505,14 @@ class EwayRapid {
});
}
const payNowButton = document.getElementById('pay-now');
document.getElementById('pay-now')?.addEventListener('click', (e) => {
let tokenInput = document.querySelector('input[name=token]');
payNowButton.querySelector('svg').classList.remove('hidden');
payNowButton.querySelector('span').classList.add('hidden');
if (tokenInput.value) {
return this.completePaymentUsingToken(e);
}