From 1ef7e6968cf5e79a0ec69dc6155369b68a8e64e9 Mon Sep 17 00:00:00 2001 From: Ty Reynolds Date: Fri, 13 Mar 2026 09:02:25 -0400 Subject: [PATCH] Updated logic for collect checkout to use Security Key. --- ns_app/api/payments.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ns_app/api/payments.py b/ns_app/api/payments.py index c7c3ee7..6b27073 100644 --- a/ns_app/api/payments.py +++ b/ns_app/api/payments.py @@ -121,19 +121,18 @@ 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") + security_key = frappe.conf.get("nmi_security_key") - if not username or not password: - frappe.throw("NMI credentials not configured") + if not security_key: + frappe.throw("NMI security key not configured") return ( "https://crystalclear.transactiongateway.com/collect/checkout" - f"?username={username}" - f"&password={password}" + f"?security_key={security_key}" f"&amount={inv.outstanding_amount}" f"&orderid={inv.name}" ) + @frappe.whitelist(allow_guest=True) def crystalclear_webhook():