From cd57206be1b1abd2878eb2f5a252332392f6973d Mon Sep 17 00:00:00 2001 From: Ty Reynolds Date: Thu, 12 Mar 2026 14:24:34 -0400 Subject: [PATCH] added to the collect checkout logic. --- ns_app/api/payments.py | 12 ++++++++++-- ns_app/public/js/customer_quick_entry.js | 11 ----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ns_app/api/payments.py b/ns_app/api/payments.py index 61669c2..c7c3ee7 100644 --- a/ns_app/api/payments.py +++ b/ns_app/api/payments.py @@ -121,12 +121,20 @@ def call_payment_api(payload): def get_collect_checkout_url(invoice): inv = frappe.get_doc("Sales Invoice", invoice) + username = frappe.conf.get("nmi_username") + password = frappe.conf.get("nmi_password") + + if not username or not password: + frappe.throw("NMI credentials not configured") + return ( "https://crystalclear.transactiongateway.com/collect/checkout" - f"?amount={inv.outstanding_amount}&reference={inv.name}" + f"?username={username}" + f"&password={password}" + f"&amount={inv.outstanding_amount}" + f"&orderid={inv.name}" ) - @frappe.whitelist(allow_guest=True) def crystalclear_webhook(): data = frappe.local.form_dict diff --git a/ns_app/public/js/customer_quick_entry.js b/ns_app/public/js/customer_quick_entry.js index 4cb6f16..fd0dc24 100644 --- a/ns_app/public/js/customer_quick_entry.js +++ b/ns_app/public/js/customer_quick_entry.js @@ -49,17 +49,6 @@ ns_app.customer.open_quick_entry = function (opts = {}) { default: "Commercial", reqd: 1 }, - { - fieldname: "custom_auto_pay_enabled", - label: "Auto Pay Enabled", - fieldtype: "Check", - default: 0 - }, - { - fieldname: "custom_auto_pay_id", - label: "AutoPay ID", - fieldtype: "Data" - }, { fieldname: "custom_send_via", label: "Send Via",