(20241217) Payment callback ready for Safaricom M-Pesa Express.

This commit is contained in:
2024-12-17 13:27:15 +05:30
parent b6ba54abd4
commit 9de9542fda
12 changed files with 632 additions and 52 deletions
@@ -353,9 +353,11 @@ class SafaricomMPesaExpress:
# If the call failed:
if api_response.httpCode in [200]:
api_json = await api_response.get_json()
success = True if str(api_json.get("ResponseCode")) == "0" else False
api_response.message = api_json.get("ResponseDescription", "N/A")
api_response.data = api_json
api_response.success = True if str(api_json.get("ResponseCode")) == "0" else False
api_response.success = success
api_response.referenceId = str(api_json["CheckoutRequestID"])
# Done here:
return api_response