Updated logic for collect checkout to use Security Key.
This commit is contained in:
@@ -121,19 +121,18 @@ def call_payment_api(payload):
|
|||||||
def get_collect_checkout_url(invoice):
|
def get_collect_checkout_url(invoice):
|
||||||
inv = frappe.get_doc("Sales Invoice", invoice)
|
inv = frappe.get_doc("Sales Invoice", invoice)
|
||||||
|
|
||||||
username = frappe.conf.get("nmi_username")
|
security_key = frappe.conf.get("nmi_security_key")
|
||||||
password = frappe.conf.get("nmi_password")
|
|
||||||
|
|
||||||
if not username or not password:
|
if not security_key:
|
||||||
frappe.throw("NMI credentials not configured")
|
frappe.throw("NMI security key not configured")
|
||||||
|
|
||||||
return (
|
return (
|
||||||
"https://crystalclear.transactiongateway.com/collect/checkout"
|
"https://crystalclear.transactiongateway.com/collect/checkout"
|
||||||
f"?username={username}"
|
f"?security_key={security_key}"
|
||||||
f"&password={password}"
|
|
||||||
f"&amount={inv.outstanding_amount}"
|
f"&amount={inv.outstanding_amount}"
|
||||||
f"&orderid={inv.name}"
|
f"&orderid={inv.name}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
@frappe.whitelist(allow_guest=True)
|
||||||
def crystalclear_webhook():
|
def crystalclear_webhook():
|
||||||
|
|||||||
Reference in New Issue
Block a user