mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for authorize page
This commit is contained in:
parent
7fe8fff43b
commit
6186cc1420
@ -78,13 +78,17 @@ class SquareCreditCard {
|
||||
}
|
||||
|
||||
async handle() {
|
||||
if (document.querySelector('meta[name=square-authorize]')) {
|
||||
await this.init();
|
||||
}
|
||||
|
||||
document
|
||||
.getElementById('authorize-card')
|
||||
?.addEventListener('click', (e) =>
|
||||
this.completePaymentWithoutToken(e)
|
||||
);
|
||||
|
||||
document.getElementById('pay-now').addEventListener('click', (e) => {
|
||||
document.getElementById('pay-now')?.addEventListener('click', (e) => {
|
||||
let tokenInput = document.querySelector('input[name=token]');
|
||||
|
||||
if (tokenInput.value) {
|
||||
@ -110,7 +114,7 @@ class SquareCreditCard {
|
||||
|
||||
document
|
||||
.getElementById('toggle-payment-with-credit-card')
|
||||
.addEventListener('click', async (element) => {
|
||||
?.addEventListener('click', async (element) => {
|
||||
document
|
||||
.getElementById('card-container')
|
||||
.classList.remove('hidden');
|
||||
@ -128,7 +132,7 @@ class SquareCreditCard {
|
||||
);
|
||||
|
||||
if (!toggleWithToken) {
|
||||
document.getElementById('toggle-payment-with-credit-card').click();
|
||||
document.getElementById('toggle-payment-with-credit-card')?.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
@section('gateway_head')
|
||||
<meta name="square-appId" content="{{ $gateway->company_gateway->getConfigField('applicationId') }}">
|
||||
<meta name="square-locationId" content="{{ $gateway->company_gateway->getConfigField('locationId') }}">
|
||||
<meta name="square-authorize" content="true">
|
||||
@endsection
|
||||
|
||||
@section('gateway_content')
|
||||
|
Loading…
x
Reference in New Issue
Block a user