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() {
|
async handle() {
|
||||||
|
if (document.querySelector('meta[name=square-authorize]')) {
|
||||||
|
await this.init();
|
||||||
|
}
|
||||||
|
|
||||||
document
|
document
|
||||||
.getElementById('authorize-card')
|
.getElementById('authorize-card')
|
||||||
?.addEventListener('click', (e) =>
|
?.addEventListener('click', (e) =>
|
||||||
this.completePaymentWithoutToken(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]');
|
let tokenInput = document.querySelector('input[name=token]');
|
||||||
|
|
||||||
if (tokenInput.value) {
|
if (tokenInput.value) {
|
||||||
@ -110,7 +114,7 @@ class SquareCreditCard {
|
|||||||
|
|
||||||
document
|
document
|
||||||
.getElementById('toggle-payment-with-credit-card')
|
.getElementById('toggle-payment-with-credit-card')
|
||||||
.addEventListener('click', async (element) => {
|
?.addEventListener('click', async (element) => {
|
||||||
document
|
document
|
||||||
.getElementById('card-container')
|
.getElementById('card-container')
|
||||||
.classList.remove('hidden');
|
.classList.remove('hidden');
|
||||||
@ -128,7 +132,7 @@ class SquareCreditCard {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!toggleWithToken) {
|
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')
|
@section('gateway_head')
|
||||||
<meta name="square-appId" content="{{ $gateway->company_gateway->getConfigField('applicationId') }}">
|
<meta name="square-appId" content="{{ $gateway->company_gateway->getConfigField('applicationId') }}">
|
||||||
<meta name="square-locationId" content="{{ $gateway->company_gateway->getConfigField('locationId') }}">
|
<meta name="square-locationId" content="{{ $gateway->company_gateway->getConfigField('locationId') }}">
|
||||||
|
<meta name="square-authorize" content="true">
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('gateway_content')
|
@section('gateway_content')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user