mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 07:24:35 -04:00
Checkout: Optin/optout for saving card
This commit is contained in:
parent
d0894cec37
commit
c6b24d1c75
@ -66,11 +66,6 @@ class AuthorizeAuthorizeCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handle() {
|
handle() {
|
||||||
//this.handleFormValidation();
|
|
||||||
|
|
||||||
// At this point as an small API you can request this.form.valid to check if input elements are valid.
|
|
||||||
// Note: this.form.valid will not handle empty fields.
|
|
||||||
|
|
||||||
this.cardButton.addEventListener("click", () => {
|
this.cardButton.addEventListener("click", () => {
|
||||||
this.cardButton.disabled = !this.cardButton.disabled;
|
this.cardButton.disabled = !this.cardButton.disabled;
|
||||||
this.handleAuthorization();
|
this.handleAuthorization();
|
||||||
|
@ -23,7 +23,7 @@ window.CKOConfig = {
|
|||||||
|
|
||||||
document.querySelector(
|
document.querySelector(
|
||||||
'input[name="store_card"]'
|
'input[name="store_card"]'
|
||||||
).value = document.getElementById('store-card-checkbox').checked ? 1 : 0;
|
).value = document.querySelector('input[name=token-billing-checkbox]:checked').value;
|
||||||
|
|
||||||
document.getElementById('server-response').submit();
|
document.getElementById('server-response').submit();
|
||||||
},
|
},
|
||||||
|
@ -84,12 +84,31 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
|
<div class="{{ ($gateway->company_gateway->token_billing == 'optin' || $gateway->company_gateway->token_billing == 'optout') ? 'sm:grid' : 'hidden' }} bg-gray-50 px-4 py-5 sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
{{ ctrans('texts.token_billing_checkbox') }}
|
{{ ctrans('texts.token_billing_checkbox') }}
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
||||||
<input type="checkbox" id="store-card-checkbox" class="form-checkbox">
|
<label class="mr-4">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
class="form-radio cursor-pointer"
|
||||||
|
name="token-billing-checkbox"
|
||||||
|
id="proxy_is_default"
|
||||||
|
value="true"
|
||||||
|
{{ ($gateway->company_gateway->token_billing == 'always' || $gateway->company_gateway->token_billing == 'optout') ? 'checked' : '' }} />
|
||||||
|
<span class="ml-1 cursor-pointer">{{ ctrans('texts.yes') }}</span>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
class="form-radio cursor-pointer"
|
||||||
|
name="token-billing-checkbox"
|
||||||
|
id="proxy_is_default"
|
||||||
|
value="false"
|
||||||
|
{{ ($gateway->company_gateway->token_billing == 'off' || $gateway->company_gateway->token_billing == 'optin') ? 'checked' : '' }} />
|
||||||
|
<span class="ml-1 cursor-pointer">{{ ctrans('texts.no') }}</span>
|
||||||
|
</label>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-white px-4 py-5 flex justify-end">
|
<div class="bg-white px-4 py-5 flex justify-end">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user