mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for Paytrace
This commit is contained in:
parent
4f362f17ab
commit
2fa360df19
@ -137,49 +137,49 @@ class PayTraceCreditCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handle() {
|
handle() {
|
||||||
this.setupPayTrace().then((instance) => {
|
Array.from(
|
||||||
this.ptInstance = instance;
|
document.getElementsByClassName('toggle-payment-with-token')
|
||||||
this.updatePayTraceLabels();
|
).forEach((element) =>
|
||||||
|
element.addEventListener('click', (element) => {
|
||||||
|
document
|
||||||
|
.getElementById('paytrace--credit-card-container')
|
||||||
|
.classList.add('hidden');
|
||||||
|
document.getElementById(
|
||||||
|
'save-card--container'
|
||||||
|
).style.display = 'none';
|
||||||
|
document.querySelector('input[name=token]').value =
|
||||||
|
element.target.dataset.token;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
Array.from(
|
document
|
||||||
document.getElementsByClassName('toggle-payment-with-token')
|
.getElementById('toggle-payment-with-credit-card')
|
||||||
).forEach((element) =>
|
?.addEventListener('click', (element) => {
|
||||||
element.addEventListener('click', (element) => {
|
document
|
||||||
document
|
.getElementById('paytrace--credit-card-container')
|
||||||
.getElementById('paytrace--credit-card-container')
|
.classList.remove('hidden');
|
||||||
.classList.add('hidden');
|
document.getElementById(
|
||||||
document.getElementById(
|
'save-card--container'
|
||||||
'save-card--container'
|
).style.display = 'grid';
|
||||||
).style.display = 'none';
|
document.querySelector('input[name=token]').value = '';
|
||||||
document.querySelector('input[name=token]').value =
|
|
||||||
element.target.dataset.token;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
document
|
this.setupPayTrace().then((instance) => {
|
||||||
.getElementById('toggle-payment-with-credit-card')
|
this.ptInstance = instance;
|
||||||
?.addEventListener('click', (element) => {
|
this.updatePayTraceLabels();
|
||||||
document
|
|
||||||
.getElementById('paytrace--credit-card-container')
|
|
||||||
.classList.remove('hidden');
|
|
||||||
document.getElementById(
|
|
||||||
'save-card--container'
|
|
||||||
).style.display = 'grid';
|
|
||||||
document.querySelector('input[name=token]').value = '';
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
document
|
document
|
||||||
.getElementById('pay-now')
|
.getElementById('pay-now')
|
||||||
.addEventListener('click', (e) => {
|
.addEventListener('click', (e) => {
|
||||||
if (
|
if (
|
||||||
document.querySelector('input[name=token]').value === ''
|
document.querySelector('input[name=token]').value === ''
|
||||||
) {
|
) {
|
||||||
return this.handlePaymentWithCreditCard(e);
|
return this.handlePaymentWithCreditCard(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.handlePaymentWithToken(e);
|
return this.handlePaymentWithToken(e);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user