When the OpenCart payment callback doesn't change the order statusA stage of processing: "Pending," "Shipped," "Complete." Custom statuses are added in the dictionary. More in the glossary →, the cause almost always lies in one of four places. Sometimes the payment request never reaches the controllerCode that receives a request and prepares data. More in the glossary →. Sometimes it arrives, but the module rejects it during validation. Sometimes validation passes, but addOrderHistory() (3.0) or addHistory() (4.1) sets a different status than you expected. And sometimes the status does change, but you're looking in the wrong place. Below is a checking order that helps you find the problem in a few minutes instead of guessing.
Examples are for OpenCart 4.1; in 4.0.x, model triggers and event handling work differently.
Where to start: where exactly is the callback getting lost?
The callback (also called a server-to-server notification or webhook) arrives at your server as a separate request from the payment systemA service that accepts cards: LiqPay, WayForPay, Monobank, and others. The commission depends on the contract. More in the glossary →. There is no customer session in it, and no cart either. The module only sees the request parameters, must find the order itself, verify the signature, and trigger the status change. How such a module works overall is described in the article about the form, callback and payment confirmation. Here we only cover what to do when the chain breaks somewhere.
It helps to split the request path into stages and check them one by one, from the server to the database:
flowchart TD
A["Payment system sends callback"] --> B{"Request in server logs?"}
B -- "no" --> B1["URL, HTTPS, WAF, redirect"]
B -- "yes" --> C{"Response 200?"}
C -- "503 / 302" --> C1["Maintenance mode or PHP error"]
C -- "200" --> D{"Signature and amount match?"}
D -- "no" --> D1["Raw data, key, currency"]
D -- "yes" --> E{"New row in order_history?"}
E -- "no" --> E1["order_id, before event, exception"]
E -- "yes" --> F["Check which status was recorded"]
The first question is always the same: did the request reach the server? Check the web server access log or the request log in the payment provider's dashboard. Most providers show which address they called, what HTTP code they received, and how many times they retried. If the dashboard shows 404, 403 or a timeout, you don't need to open the module code yet.
Why doesn't the request reach the module controller?
Wrong callback address
The module usually builds the address via $this. There is a trap here that is easy to miss: the method HTML-encodes ampersands.
- OpenCart 3.0:
link($route, $args = '', $secure = false)always replaces&with&when arguments are passed. - OpenCart 4.1:
link(string $route, $args = '', bool $js = false)encodes ampersands unless the third parameter isfalse. For the address you give the payment provider in an API request, passtrue.
If &order_id=15 ends up in the callback address, the payment system will send the request, but the parameter will arrive under the name amp;order_id, and the module won't find it. Without arguments the address looks like index.php?route=... and this problem doesn't occur.
A second common mistake concerns the method separator in the route. In 3.0 the method is separated by a slash (extension/), in 4.1 by a dot (extension/). A module moved from 3.0 without this fix returns a "not found" page in 4.1. Details are in the article about route= routing in 3.0 and 4.1.
Maintenance mode
The versions behave differently here, and this is a frequent cause of "it broke after the upgrade."
- OpenCart 3.0:
startup/maintenanceskips routes that start withextension/payment, as well asapi. The callback works even when the store is closed for maintenance. - OpenCart 4.1: the exception only remains for
api. Any payment module callback receives the maintenance page with code 503 if the administrator isn't logged in in the same browser (the payment provider, of course, isn't).
So if in 4.1 you closed the store overnight for work, and orders were paid from cached pages or links, those callbacks won't be processed. Most providers retry the request, but not all of them, and not indefinitely.
Protection in front of OpenCart
Hosting WAFs, Cloudflare with a browser check, HTTP authentication on a test domain, or a redirect from http to https or from www to non-www can stop the request before it reaches PHP. Redirects are especially tricky: some payment system clients don't follow a 301 and don't resend the POST body. That's why the callback address must be final, meaning it already uses the correct protocol and domain.
How do you see what the module received and what it responded?
Once the request reaches PHP, the next step is to write everything that arrived to your own log. Don't rely on the core error log: it only records PHP errors, not the module rejecting a wrong signature. Logging the raw request at the start of the callback() method immediately shows what actually arrives.
Example: diagnostic log in the callback (OpenCart 4.1)
public function callback(): void {
$log = new \Opencart\System\Library\Log('mypay_callback.log');
$raw = file_get_contents('php://input');
$log->write('METHOD: ' . ($this->request->server['REQUEST_METHOD'] ?? ''));
$log->write('CONTENT_TYPE: ' . ($this->request->server['CONTENT_TYPE'] ?? ''));
$log->write('RAW: ' . $raw);
$log->write('POST: ' . json_encode($this->request->post));
// далі звичайна перевірка підпису й зміна статусу
}
In 3.0 the class is global, so the line looks like $log = new Log('mypay_callback.log');. In both branches the file goes into the logs directory (DIR_LOGS with config.php); the location is described in the article about the storage directory. After diagnostics, remove the raw body logging or mask personal data in it.
This log immediately answers two common questions:
- POST is empty, but RAW is filled. The payment system sends JSON (
application/json). PHP fills$_POSTonly for forms, so$thiswill be empty in both versions. Read->request ->post php://inputand parse the JSON yourself. - Values in POST differ from RAW. The Request class in both branches passes input through
htmlspecialchars. Quotes and ampersands in POST are already converted, so a signature computed from them won't match. Why this happens is explained in the article about Request and Response.

Also check the core error log in the admin: System → Maintenance → Error Logs. If Display Errors is enabled on the Server tab in the settings, the PHP warning text is output directly into the response body. A payment system expecting exactly OK or JSON treats such a response as an error and retries the request. In 4.1 there's one more variant: with error display turned off, an unhandled exception redirects the request to error.html, and the payment system sees a 302 instead of a 200.
The module rejects the callback: signature, amount, order
If the log shows the data arrived but the status didn't change, add a log entry to every rejection branch: "signature mismatch," "order not found," "amount mismatch." Without this, the rejection is silent, and from the outside it looks as if the module "does nothing."
Signature
Typical causes of a mismatch: the signature is computed from processed data instead of raw data (see above); the module settings contain the test key while the provider is in live mode (or vice versa); there's an extra space in the key after copying; or the field being signed is not the one the provider signs. Log both values, the computed one and the received one, and compare them manually.
Order identifier
Often the module doesn't pass the payment system a bare order_id but a string with a prefix or timestamp, so the identifier stays unique on repeated payment. If in the callback you simply do (int), a string like shop-15-1732 becomes 0. getOrder(0) finds nothing, and addOrderHistory() (3.0) or addHistory() (4.1) silently does nothing: the whole method is wrapped in if ($order_info).
Amount and currency
In the order table, the total field is stored in the store's default currency. The customer, however, is billed in the order currency at the currency_value rate. If the module sent the amount via $this but the callback compares it with a "raw" total, the check will never pass on a multi-currencyDisplaying prices in several currencies with an exchange rate to the base currency. The order stores the currency chosen by the customer and its rate (currency_code, currency_value), while amounts are stored in the store's base currency. More in the glossary → store. Compare using the same expression that was used to calculate the amount when sending, and account for rounding to the cent. How these fields are filled is shown in the article about the order table.
addOrderHistory (3.0) or addHistory (4.1) was called, but the status is wrong: what to check?
Sometimes the log shows that validation passed and the call was made, yet the order in the admin still has the old status or isn't visible at all. First look in the database to see what was actually recorded:
Example: order status history
SELECT o.order_id, o.order_status_id, h.order_status_id AS history_status, h.comment, h.date_added
FROM oc_order o
LEFT JOIN oc_order_history h ON h.order_id = o.order_id
WHERE o.order_id = 15
ORDER BY h.date_added;
Status 0 and "missing" orders
If no status is selected for successful payment in the module settings, the key such as payment_mypay_order_status_id is empty, and 0 is passed to the method. The order stays with status 0. By default, the order list in both admin versions shows only order_status_id > 0, so such an order isn't visible among regular ones. You can find it by selecting Missing Orders in the status filter (the name may differ in translated admin versions).

Fraud status instead of paid
When an order moves to the processing or complete status, addOrderHistory() in 3.0 and addHistory() in 4.1 runs two checks that can replace your status:
- Anti-fraud modules (type
fraud), if they are enabled and the customer isn't marked as "safe." Thecheck()method of such a module can return a different status. - The
confirm()method of total modules. A coupon or reward points (and in 3.0, also a gift voucher) that have already been used or are insufficient returnconfig_fraud_status_id.
As a result, the status selected in the Fraud Order Status field appears in the history. Check what is selected on the Option tab under System → Settings, and whether the order has a coupon.

The status is not in the "processing statuses"
Stock deduction, coupon confirmation and emails only run when moving to statuses marked in the Processing Order Status or Complete Order Status fields on the same Option tab. If the module sets a status that isn't in these lists, the status changes but the rest of the logic won't run. This mechanism is covered in full in the article about addOrderHistory and status changes.
A before event intercepts the call
In 3.0, a handler for the catalog/ event that returns anything other than null cancels the method call. The status doesn't change and there's no error. In 4.1, the value returned by a handler is ignored, but the handler can modify arguments by reference (for example, the status). Review the list under ExtensionsAdditional functionality: a module, a payment or shipping method, a feed, or a theme. They are managed in "Extensions → Extensions." More in the glossary → → Events and temporarily disable third-party events on the order model. How triggers work is described in the article about the event system.
How do you test the callback without a real payment?
The fastest way is to repeat the request yourself. Copy the raw body and headers sent by the payment system from your own log, and send them with curl to the same address:
Example: replaying the callback from the log (4.1)
curl -i -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-raw "data=...&signature=..." \
"https://example.com/index.php?route=extension/mypay/payment/mypay.callback"
The -i flag shows the response code and headers, so you can immediately see a 503, a 302, or extra warning text in the body. Re-running the same request is safe for the status: addOrderHistory() (3.0) or addHistory() (4.1) will add one more row to the history, but stock and coupons are processed only on the first transition to the processing status. Remember that the customer email may be sent a second time if the module passes $notify = true, so on a live store it's better to test on your own order.
If the provider has a test mode, verify that it uses separate keys and that the module is actually switched to it. Many "mysterious" failures happen because a test payment is signed with the test key while the module checks against the live one.
A special case: the payment succeeded, but the customer didn't return to the site. In 3.0, the order already exists at that point with status 0 (created by the confirmation step), so the callback has something to update. How and when it appears in 3.0 and 4.1 is covered in the article about checkout in code. A version of this same problem for the store owner, without code, is described in the article on what to do if the payment went through but the status didn't change.
Summary
- First establish whether the request reached the server: the payment provider's dashboard and the access log show the address, response code and retries.
- Check the address:
&withurl->link(), the method separator (slash in 3.0, dot in 4.1), the final protocol, and a domain without redirects. - In 4.1, maintenance mode blocks payment module callbacks; in 3.0 it does not.
- Log the raw request and every rejection branch. JSON doesn't go into
$this, and compute the signature from raw data.->request ->post - Verify the amount in the same currency and with the same rate as when it was sent, and extract
order_idfrom the string carefully. - If the call was made but the status is wrong, check status 0, the Fraud status, the processing status lists, and events on the order model.
Other articles on how the core calculates the cart, creates orders and changes statuses are collected in the section "Cart, checkout and orders in code".