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.

This commit is contained in:
Ty Reynolds
2026-04-14 09:40:36 -04:00
parent cc44683972
commit e7e9fc96c2
2 changed files with 8 additions and 3 deletions

View File

@@ -120,6 +120,9 @@ def call_payment_api(payload):
@frappe.whitelist() @frappe.whitelist()
def run_token_payment(invoice, token, cardholder_name=None, billing_zip=None, save_autopay=0): 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) inv = frappe.get_doc("Sales Invoice", invoice)
customer = frappe.get_doc("Customer", inv.customer) customer = frappe.get_doc("Customer", inv.customer)

View File

@@ -142,9 +142,9 @@ function open_manual_payment_form(frm) {
</div> </div>
<div class="mt-3"> <div class="mt-3">
<label> <label style="color: red; font-weight: bold;">
<input type="checkbox" id="save_autopay_${uid}" /> <input type="checkbox" id="save_autopay_${uid}" />
Save for Auto Pay Save for Auto Pay (** Not Fuctional Yet **)
</label> </label>
</div> </div>
@@ -270,7 +270,9 @@ function open_manual_payment_form(frm) {
const finalZip = enteredZip || frm.doc.billing_zip || frm.doc.pincode; const finalZip = enteredZip || frm.doc.billing_zip || frm.doc.pincode;
// Check autopay enrollment choice // 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, { run_token_payment(frm, response.token, dialog, {