(cherry picked from commit 6d3e9bce5f)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
This commit is contained in:
@@ -143,6 +143,9 @@ def verify_transaction(**kwargs):
|
||||
transaction_response = frappe._dict(kwargs["Body"]["stkCallback"])
|
||||
|
||||
checkout_id = getattr(transaction_response, "CheckoutRequestID", "")
|
||||
if not isinstance(checkout_id, str):
|
||||
frappe.throw(_("Invalid Checkout Request ID"))
|
||||
|
||||
integration_request = frappe.get_doc("Integration Request", checkout_id)
|
||||
transaction_data = frappe._dict(loads(integration_request.data))
|
||||
total_paid = 0 # for multiple integration request made against a pos invoice
|
||||
@@ -233,6 +236,9 @@ def process_balance_info(**kwargs):
|
||||
account_balance_response = frappe._dict(kwargs["Result"])
|
||||
|
||||
conversation_id = getattr(account_balance_response, "ConversationID", "")
|
||||
if not isinstance(conversation_id, str):
|
||||
frappe.throw(_("Invalid Conversation ID"))
|
||||
|
||||
request = frappe.get_doc("Integration Request", conversation_id)
|
||||
|
||||
if request.status == "Completed":
|
||||
|
||||
Reference in New Issue
Block a user