From e7e9fc96c21a1bd9f19a159e0f8ef4b127b6b2ed Mon Sep 17 00:00:00 2001 From: Ty Reynolds Date: Tue, 14 Apr 2026 09:40:36 -0400 Subject: [PATCH] Added feature toggle for the check box on custom form. Turned off at the moment so we can push to prod even though this feature is complete. --- ns_app/api/payments.py | 3 +++ ns_app/public/js/sales_invoice.js | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ns_app/api/payments.py b/ns_app/api/payments.py index 9865c82..b61a6b8 100644 --- a/ns_app/api/payments.py +++ b/ns_app/api/payments.py @@ -120,6 +120,9 @@ def call_payment_api(payload): @frappe.whitelist() def run_token_payment(invoice, token, cardholder_name=None, billing_zip=None, save_autopay=0): + if not frappe.conf.get("enable_autopay_signup"): + save_autopay = 0 + inv = frappe.get_doc("Sales Invoice", invoice) customer = frappe.get_doc("Customer", inv.customer) diff --git a/ns_app/public/js/sales_invoice.js b/ns_app/public/js/sales_invoice.js index 7d29c2e..3ddb486 100644 --- a/ns_app/public/js/sales_invoice.js +++ b/ns_app/public/js/sales_invoice.js @@ -142,9 +142,9 @@ function open_manual_payment_form(frm) {
-
@@ -270,7 +270,9 @@ function open_manual_payment_form(frm) { const finalZip = enteredZip || frm.doc.billing_zip || frm.doc.pincode; // Check autopay enrollment choice - const save_autopay = document.getElementById(`save_autopay_${uid}`)?.checked; + const AUTOPAY_ENABLED = false; + const checkbox = document.getElementById(`save_autopay_${uid}`); + const save_autopay = AUTOPAY_ENABLED ? checkbox?.checked : 0; run_token_payment(frm, response.token, dialog, {