(20241217) Payment message capture improved.
This commit is contained in:
@@ -346,12 +346,12 @@ class SafaricomMPesaExpress:
|
||||
)
|
||||
|
||||
# If the call failed:
|
||||
if api_response.httpCode == 400:
|
||||
if api_response.httpCode not in [200]:
|
||||
api_json = await api_response.get_json()
|
||||
api_response.message = f"{api_json['errorCode']} -> {api_json['errorMessage']}"
|
||||
|
||||
# If the call failed:
|
||||
if api_response.httpCode in [200]:
|
||||
else:
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user