1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00
This commit is contained in:
Lars Kusch 2022-12-17 06:47:43 +01:00
parent 01fbebb42e
commit fdafa04904
2 changed files with 34 additions and 28 deletions

View File

@ -42,22 +42,25 @@ class ProcessBACS {
location.href=document.querySelector('meta[name=stripe-redirect-url').content;
});}
else{
let token = document.querySelector('input[name=token]').value;
let payNowButton = document.getElementById('pay-now');
this.payNowButton = payNowButton;
this.payNowButton.disabled = true;
this.payNowButton.querySelector('svg').classList.remove('hidden');
this.payNowButton.querySelector('span').classList.add('hidden');
document.getElementById('pay-now').addEventListener('click', (e) => {
let token = document.querySelector('input[name=token]').value;
let payNowButton = document.getElementById('pay-now');
this.payNowButton = payNowButton;
this.payNowButton.disabled = true;
this.payNowButton.querySelector('svg').classList.remove('hidden');
this.payNowButton.querySelector('span').classList.add('hidden');
this.stripe.confirmBecsDebitPayment(
document.querySelector('meta[name=pi-client-secret').content,
{}
).then((result) => {
if (result.error) {
return this.handleFailure(result.error.message);
}
this.stripe.confirmBecsDebitPayment(
document.querySelector('meta[name=pi-client-secret')
.content,
{}
).then((result) => {
if (result.error) {
return this.handleFailure(result.error.message);
}
return this.handleSuccess(result);
return this.handleSuccess(result);
});
});
}
};

View File

@ -42,22 +42,25 @@ class ProcessBACS {
location.href=document.querySelector('meta[name=stripe-redirect-url').content;
});}
else{
let token = document.querySelector('input[name=token]').value;
let payNowButton = document.getElementById('pay-now');
this.payNowButton = payNowButton;
this.payNowButton.disabled = true;
this.payNowButton.querySelector('svg').classList.remove('hidden');
this.payNowButton.querySelector('span').classList.add('hidden');
document.getElementById('pay-now').addEventListener('click', (e) => {
let token = document.querySelector('input[name=token]').value;
let payNowButton = document.getElementById('pay-now');
this.payNowButton = payNowButton;
this.payNowButton.disabled = true;
this.payNowButton.querySelector('svg').classList.remove('hidden');
this.payNowButton.querySelector('span').classList.add('hidden');
this.stripe.confirmBecsDebitPayment(
document.querySelector('meta[name=pi-client-secret').content,
{}
).then((result) => {
if (result.error) {
return this.handleFailure(result.error.message);
}
this.stripe.confirmBecsDebitPayment(
document.querySelector('meta[name=pi-client-secret')
.content,
{}
).then((result) => {
if (result.error) {
return this.handleFailure(result.error.message);
}
return this.handleSuccess(result);
return this.handleSuccess(result);
});
});
}
};