Callback.php giving a fatal error


#1

Trying to use callback example to update my transaction but failing with the following error.

Fatal error : Uncaught exception ‘Paynow\Payments\HashMismatchException’ in C:\xampp\htdocs\payment\src\Payments\Paynow.php:325 Stack trace: #0 C:\xampp\htdocs\payment\callback.php(32): Paynow\Payments\Paynow->processStatusUpdate() #1 {main} thrown in C:\xampp\htdocs\payment\src\Payments\Paynow.php on line 325

on callback.php line 32 i have - $status = $paynow->processStatusUpdate();


#2

Hi @cobsis. This is likely because you are running this on localhost. In the callback example, the assumption is that you are running on a server that can receive a POST request from Paynow. When a payment is completed, paynow sends a post request with a status update to the result url you set. So as the error suggests, you cannot verify the hash because there is no post data coming in from Paynow as it cannot contact your server.


#3

Would callback.php even be reached without having received a POST from Paynow?

@cobsis could you share more information on your environment/setup in order to understand better?