(20241217) Payment message capture improved.
This commit is contained in:
@@ -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}'"
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user