> For the complete documentation index, see [llms.txt](https://docs.ecommerce.seb.ee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecommerce.seb.ee/integration/web-plugins/opencart/order-lifecycle-and-operations.md).

# Order lifecycle & Operations

How the SEB E-commerce Payment Gateway extension for OpenCart handles orders, order statuses, and day-to-day operations

## How order statuses change

Two paths update an order after payment: the customer returning to your store, and the authoritative server-to-server **callback notification**. Neither path trusts the message it receives — both re-check the real payment status with the gateway before changing anything ([how this is verified](/integration/web-plugins/opencart/configuration.md#how-callback-notifications-are-verified)). Every change appears in the order's history with a comment.

| Payment status at the gateway     | OpenCart order status                           | What it means                                                                            |
| --------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Payment page opened, not finished | **Pending** ("Payment initiated")               | Waiting for the customer to pay                                                          |
| Sent for processing / Authorized  | **Pending** + on-hold/pre-authorization comment | Money reserved or in flight, not final. Capture in the Merchant Portal if pre-authorized |
| Captured / Settled                | **Processing** ("Payment completed")            | Paid — fulfil as usual                                                                   |
| Cancelled / Abandoned / Failed    | **Cancelled** (with reason comment)             | The customer is returned to checkout to retry                                            |

Notes for merchants:

* The mapping uses OpenCart's default statuses. If your store renumbered or removed them, contact SEB support before going live ([Configuration](/integration/web-plugins/opencart/configuration.md)).
* An order stuck in *Pending* with a payment the customer says succeeded: check the Merchant Portal (<https://merchantportal.ecommerce.sebgroup.com>) first, then the callback registration.

![A paid SEB E-commerce Payment Gateway order in Sales → Orders → View, showing status Processing and the order-history comments recording the payment progression from Pending through to Processing.](https://1157570179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuBDtfypkI85zidcVwaDj%2Fuploads%2Fx9TjRqeTq7I0XDKBtSxM%2Foc-order-detail-pending-processing.png?alt=media)

## What you do where

| Task                             | Where                                                                                                                                                                                                                                                                         |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| See payment status per order     | **Sales → Orders → View** (order history comments). The gateway payment ID is stored on the order but OpenCart's stock order screen never displays it — check `egw_checkout.log` (**System → Maintenance → Error Logs**) if you need to match an order to the Merchant Portal |
| Capture a pre-authorized payment | Merchant Portal                                                                                                                                                                                                                                                               |
| Issue a refund                   | Merchant Portal — the admin panel has no refund action for this payment method; the order status updates automatically once the gateway confirms the refund                                                                                                                   |
| Reconciliation                   | Merchant Portal; match via the payment ID                                                                                                                                                                                                                                     |

## Edge cases

* **Callback never arrives:** orders stall although payment progressed. Fix the callback registration ([Configuration](/integration/web-plugins/opencart/configuration.md)); no scheduled re-check exists.
* **Duplicate notifications** are recognized and ignored safely.
* **Customer pays but never returns:** the callback still completes the order.
* **Customer logged out and shown an error after paying:** **Session Samesite Cookie** is still *Strict*. Set it to *Lax* ([Installation](/integration/web-plugins/opencart/installation.md)). Until then the customer returns logged out and sees *Something went wrong. Please try again.* although the payment succeeded, and may pay a second time. The order, and any card the customer chose to save, is updated only when the callback arrives. Check **Sales → Orders** and the Merchant Portal before asking the customer to retry.
* **A saved card is no longer accepted** by the gateway: the customer sees *This saved card can't be used. Please pay with a new card.*, the order is cancelled like any failed payment, and the card is removed from their saved cards. See [Saved cards](/integration/web-plugins/opencart/configuration.md#saved-cards).

## For developers

Callback endpoint: `POST https://your-store.example/index.php?route=extension/egw_checkout/callback`, JSON `{type, paymentId, merchantReference, paymentStatus}`; `merchantReference` is the OpenCart order ID. The handler requires the order's stored transaction ID to match `paymentId` and re-fetches the live status before applying anything; the request itself is not signed (see [How callback notifications are verified](/integration/web-plugins/opencart/configuration.md#how-callback-notifications-are-verified)). Return route: `extension/egw_checkout/redirect` (token-protected against cross-session use). Log: `system/storage/logs/egw_checkout.log`, also visible under **System → Maintenance → Error Logs**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecommerce.seb.ee/integration/web-plugins/opencart/order-lifecycle-and-operations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
