From c6b24d1c75b3d91b0bba6907cbe8218d14979607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 21 Sep 2020 11:34:06 +0200 Subject: [PATCH] Checkout: Optin/optout for saving card --- .../authorize-authorize-card.js | 5 ---- resources/js/clients/payments/checkout.com.js | 2 +- .../gateways/checkout/credit_card.blade.php | 25 ++++++++++++++++--- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/resources/js/clients/payment_methods/authorize-authorize-card.js b/resources/js/clients/payment_methods/authorize-authorize-card.js index 89b454820..9af8543c8 100644 --- a/resources/js/clients/payment_methods/authorize-authorize-card.js +++ b/resources/js/clients/payment_methods/authorize-authorize-card.js @@ -66,11 +66,6 @@ class AuthorizeAuthorizeCard { } 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.disabled = !this.cardButton.disabled; this.handleAuthorization(); diff --git a/resources/js/clients/payments/checkout.com.js b/resources/js/clients/payments/checkout.com.js index 1d4d4de59..f00797a96 100644 --- a/resources/js/clients/payments/checkout.com.js +++ b/resources/js/clients/payments/checkout.com.js @@ -23,7 +23,7 @@ window.CKOConfig = { document.querySelector( '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(); }, diff --git a/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php b/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php index 0c0f85f5f..4c97ad520 100644 --- a/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php @@ -84,12 +84,31 @@ @else -
-
+
+
{{ ctrans('texts.token_billing_checkbox') }}
- + +