(20241217) Payment message capture improved.

This commit is contained in:
2024-12-17 13:58:50 +05:30
parent 9de9542fda
commit 8b39393ed3
5 changed files with 23 additions and 12 deletions
@@ -198,11 +198,12 @@ async def safaricom_m_pesa_express_callback(
# Figure out which of the above codes is relevant to you:
pg_reference_id = inbound_data["Body"]["stkCallback"]["CheckoutRequestID"]
pg_result_code = int(inbound_data["Body"]["stkCallback"]["ResultCode"])
pg_result_desc = inbound_data["Body"]["stkCallback"]["ResultDesc"]
relevant_code = code_map.get(
pg_result_code,
{
"status": "unknown",
"message": f"Unknown code '{pg_result_code}' from the payment gateway."
"message": f"Unknown code '{pg_result_code}' from the payment gateway. PG: '{pg_result_desc}'"
}
)