You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when HTTP request come and that function get executed,
IF the HTTP request body is not exist, THEN it will unexpectedly throw error of Trying to access array offset on value of type null on line 26.
which could be misleading because it just throw array-key related error message without actually explaining what went wrong.
Expected:
The code should better check
Is parsing of the HTTP request body succeeds ?
Is json_decode succeeds ?
is $raw_notification['transaction_id'] exists?
optionally: Is the HTTP request valid HTTP POST method?
Then the code should throw a more user-friendly error message that indicate what failed.
So that user could understand better.
Note:
This will not prevent the actual root cause of issue that triggers the exception. But at least by letting user know what process failed, they can have better insight in investigating the actual root cause. e.g. HTTP Request body is missing from the request, then they can check their infra is something removing the body.
The text was updated successfully, but these errors were encountered:
Current Unexpected:
midtrans-php/Midtrans/Notification.php
Lines 23 to 28 in 4929d87
On that function,
Trying to access array offset on value of type null
on line 26.Expected:
json_decode
succeeds ?$raw_notification['transaction_id']
exists?Note:
The text was updated successfully, but these errors were encountered: