Just had an order come through via Woldpay and the order cleared in both Worldpay and in the Admin orders area. However, the client emailed asking if the order went through successfully as instead of the success message they got the attached error instead..
"There are an error processing your order. Please contact the shop administrator for help."
The order status in Opencart Admin was correctly set as 'Pending' and there don't appear to be any issues with it, it's only that the wrong message was provided to client. The shop has been running for a while now and no previous order issues such as this one..
I've spoken to Worldpay but they said the order looks fine their end and the issue is somewhere on Opencart side.
Does anyone know why it happened, and how to fix it?
Many Thanks!
Attachments
image004.gif (8.52 KiB) Viewed 5927 times
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I took your advice and enabled the log file, which gave the following 2 errors on the next order:
PHP Notice: Undefined variable: order_status_id in /public_html/domain/catalog/controller/extension/payment/worldpay.php on line 194
PHP Notice: Undefined variable: order_status_id in /public_html/domain/catalog/controller/extension/payment/worldpay.php on line 197
I've also spoke to Worldpay (again) and they keep saying that there is no issue in the payment response they are sending back and that the issue is on Opencart's side and that it is likely something with how the webhook is being interpreted..
I've attached the file which these 2 errors relate to, from what I can see it seems the Order Status ID is not being recognized for some reason and therefore resulting in the issue?
Any help is much appreciated as it's causing major problems with customers. Thanks!
Attachments
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
1) there is no admin/view/template/extension/payment/worldpay.twig file so I could not update it.
2) After updating the rest as per your instructions I re-installed the Worldpay module and enabled it but it won't enable now. Everytime I save the module it appears as disabled (and does not work on front-end).
Any idea how it can be resolved please?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Try logging the $message variable to see what's included in it, and if the "paymentStatus" variable names have changed. If they have, you should change it in that code block. To log that $message variable, you'd do an edit like this:
Code: Select all
IN:
/catalog/controller/extension/payment/worldpay.php
AFTER:
$message = json_decode(file_get_contents('php://input'), true);
ADD:
$this->log->write($message);
If the "paymentStatus" isn't set in there, you might be able to use some other data to determine what the order status is. Also, since getting that data requires file_get_contents(), make sure that allow_url_fopen is enabled on your server.
Hope that helps
Code: Select all
$this->log->write('WORLDPAY :: DEBUG :: ' . $message);
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Looking at the error log I'm attaching a screenshot of the data recorded.. The order code has been replaced but I set them differently just to show that both instances had the status of "SUCCESS" but only one order was recorded.
Both orders are from the same client, but having got the error first time around, they went back and placed the same order again.
Can anyone help on the above issue please?
Thanks!
Attachments
orders.gif (6.29 KiB) Viewed 5699 times
Having looked into it further I see that the orders that are giving the customer the error are being saved to the database with order_status_id of '0'. So for some reason they are being treated as missing orders? Any reasons why?
I don't see anywhere from your above reply where the results based on the codes I've posted above are showing in your screenshot.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
The last screenshot I sent was of a single customer who had to place the order twice, for it to go through correctly. I copied and pasted the values from the error log in a spreadsheet for clear comparison.
I don't see any other values relating to the payment status in the log file. The lines directly relating to the problematic order are:
------------
2018-03-05 12:24:08 - PHP Notice: Undefined index: firstname in /vqmod/vqcache/vq2-system_storage_modification_catalog_model_checkout_order.php on line 834
2018-03-05 12:24:08 - PHP Notice: Undefined index: lastname in /vqmod/vqcache/vq2-system_storage_modification_catalog_model_checkout_order.php on line 834
2018-03-05 12:24:09 - Array
(
[notificationEventType] => ORDER_STATE_CHANGE
[orderCode] => 12345
[paymentStatus] => SUCCESS
[environment] => LIVE
)
2018-03-05 12:24:09 - PHP Warning: Cannot modify header information - headers already sent by (output started at /catalog/controller/startup/error.php:34) in /system/library/response.php on line 12
I hope that helps. Thanks!
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: Amazon [Bot], Semrush [Bot] and 17 guests