OpenCart extension
Accept VEX Pay in an OpenCart 3 or 4 store: buyers pay on VEX Pay’s hosted checkout and the order status follows the payment.
What it does
The VEX Pay extension adds one payment method, VEX Pay, to an OpenCart store. At checkout the buyer is sent to VEX Pay’s hosted checkout, pays with the methods your account accepts (for example Pago Móvil, Débito Inmediato or USDT) and comes back to the store. No card or bank data touches the store. The extension then moves the order from Pending to paid, canceled or failed by itself, from VEX Pay’s signed webhooks and from re-checks, so nobody has to compare transfers and mark orders by hand.
It is for OpenCart 3 and OpenCart 4 stores and for the developers who look after them. It follows the same rules as every VEX Pay store plugin: an order status only moves forward, each event is applied once, and a payment that belongs to another integration is ignored.
OpenCart 4.0.2+: vexpay.ocmod.zip. OpenCart 3.0.4+: vexpay-oc3.ocmod.zip. The extension is new: try it with a test key before you take live payments. See "Install" below.
For business owners: a short overview of the OpenCart integration, in Spanish, at vexpay.app/opencart-venezuela.
Versions and which build to pick
OpenCart 3 and 4 install extensions differently, so there are two builds. Pick the one for your store’s version (Admin footer, or System > Maintenance).
| Your OpenCart | Build | File |
|---|---|---|
| 4.0.2.0 or later 4.x (for example 4.1.0.4) | 4.x build | vexpay.ocmod.zip (keep this file name: OpenCart 4 installs the extension under it) |
| 3.0.4.0 or later 3.0.x (for example 3.0.5.1) | 3.x build | vexpay-oc3.ocmod.zip |
Both need PHP 8.1 or later with the cURL and JSON extensions. OpenCart 2.x, 4.0.0–4.0.1 and 3.0.3.x and older are not supported. If the settings page says the build doesn’t match your version, uninstall it and install the other build.
Requirements
- A VEX Pay account. Live payments need live approval (see Going live); test mode works from the start.
- An API key from the portal: a test key to try the flow, a live key when your account is approved.
- The payment methods you want to offer enabled on your account. The hosted checkout shows only the methods your account accepts.
- Store currency USD or VES for the orders paid with VEX Pay. Other currencies don’t see the method.
- For webhooks: a public store address with https. A store on localhost still works through re-checks (see "Re-checks and the cron URL").
Install
OpenCart 4.0.2 or later: vexpay.ocmod.zip (keep the file name). OpenCart 3.0.4 or later: vexpay-oc3.ocmod.zip. Version 1.0.0, beta: try it with a test key first.
- OpenCart 4: upload the 4.x build
Admin > Extensions > Installer > Upload, choose
vexpay.ocmod.zip, then click the green Install button next to it. - OpenCart 4: install the payment method
Extensions > Extensions > choose Payments > VEX Pay > Install (the green +), then Edit.
- OpenCart 3: upload the 3.x build
Admin > Extensions > Installer > Upload, choose
vexpay-oc3.ocmod.zip. The files are copied when the progress bar finishes. - OpenCart 3: install the payment method
Extensions > Extensions > choose Payments > VEX Pay > Install (the green +), then Edit.
- Both: configure and enable
Paste your API key, choose currencies and statuses, turn the method on and save (see "Settings").
Install creates one table, vexpay_payment (one row per order paid with VEX Pay), and one event that writes the refund note.
Settings
| Setting | What it does |
|---|---|
| API key | Your VEX Pay key. It is checked with VEX Pay when you save, and a key VEX Pay refuses is not saved. After saving it is shown masked (for example vxp_live_••••3f9a); leave the field empty to keep it. |
| Enabled | Shows VEX Pay at checkout. Needs a key. |
| Name at checkout | The method’s name buyers see (default "VEX Pay"). |
| Currencies | USD, VES or both. VEX Pay is offered only when the buyer’s currency is one of them. VES orders are charged the exact bolívar amount. |
| Minimum and maximum total | Optional, in the store’s default currency. Outside the range the method is hidden. |
| Order statuses | Which of your statuses to use for Pending, Paid, Canceled, Failed and Reversed by VEX Pay (defaults: Pending, Processing, Canceled, Failed, Refunded). |
| Manual refund note | The statuses that add the refund note to a VEX Pay order (defaults: Refunded and Reversed). |
| Cron URL | Your store’s re-check address with its secret token. Read-only; see "Re-checks and the cron URL". |
- Test and live keys. A test key creates test payments that move no real money; the settings page says which kind of key is saved. To go live, paste the live key and save.
- Webhook, automatically. Saving a valid key registers your store’s webhook address with VEX Pay (events
payment.pending,payment.completed,payment.failed,payment.canceled,payment.reversed) and keeps the signing secret; the secret is never shown. Saving again with the same key only updates the address if your store’s URL changed. A new key registers a new endpoint. - Store on localhost or without https. The webhook is not registered and the page says so. Payments still work: orders update when the buyer returns, when you open the order in the admin and through the cron URL.
- Several stores. OpenCart’s multi-store is supported: pick the store at the top of the settings page. Each store has its own key (it can be a different VEX Pay account), webhook, cron token and statuses.
How a payment flows
- The buyer confirms the order
The order is added with your Pending status and the extension creates one VEX Pay checkout session for the order total, with the reference
oc_<store id>_<order id>. Confirming again reuses the same session. - The buyer pays on VEX Pay
On VEX Pay’s hosted checkout, with the methods your account accepts.
- VEX Pay tells the store
A signed webhook moves the order to your Paid status, with a history line holding the VEX Pay payment id and the method.
- The buyer comes back
The return page re-reads the payment and shows the order. The return alone never marks an order paid: only VEX Pay’s answer does.
| VEX Pay | Order status | History line |
|---|---|---|
| Checkout open, no payment yet | Pending | Waiting for the buyer’s payment |
COMPLETED | Paid | Payment id and method |
FAILED while the checkout is still open | stays Pending (the buyer can try again) | — |
FAILED or CANCELED after the checkout closed, or the checkout expired | Canceled | The payment was not completed |
COMPLETED but short (underpaid) | Failed | Check the payment in your portal before shipping |
COMPLETED after the order was canceled | unchanged | A payment arrived for a canceled order: check it in your portal |
REVERSED | Reversed by VEX Pay (default Refunded) | The payment was reversed |
A late or repeated notification never moves an order back: a payment.pending that arrives after the order is paid changes nothing and adds no history line, and the same event twice is applied once. A webhook with a bad or missing signature gets 401 and changes nothing; one for another integration or an unknown order gets 200 and changes nothing.
Re-checks and the cron URL
OpenCart has no scheduler of its own, so the extension re-reads payments from VEX Pay at three moments. Any of them corrects an order whose webhook was lost.
- The cron URL, every 10 minutes: re-reads up to 50 of the store’s pending VEX Pay orders that have had no news for 10 minutes. Copy it from the settings page (it carries a secret token; a wrong token gets 403) and call it from your host’s cron, for example
*/10 * * * * curl -s "<cron URL>". - The buyer’s return from the checkout re-reads that order.
- Opening the order in the admin re-reads it and shows a VEX Pay box with the reference, payment id and status.
Without a cron job, orders are still corrected when the buyer returns or when you open them; the cron URL is what catches a buyer who closes the tab after paying.
Refunds are made by hand
OpenCart has no refund hook for payment extensions, so the extension never returns money. When you change a VEX Pay order to one of the "manual refund note" statuses, its history gets a note: the extension does not refund; return the money to the buyer yourself and record it in your VEX Pay portal. Nothing is sent to VEX Pay. If you need VEX Pay to reverse a payment, ask VEX Pay support.
When VEX Pay itself reverses a payment, the order moves to your "Reversed by VEX Pay" status with its own history line, and no refund note is added.
Troubleshooting
| Problem | What to do |
|---|---|
| "VEX Pay didn’t accept this API key" | Copy the key again from the portal, whole, and check you are using a key of the right account. Test and live keys are different. |
| Webhook not arriving | The store needs a public https address. Open the settings page: it says whether the webhook is registered. Save again to register it. Meanwhile, set up the cron URL; it corrects orders every 10 minutes. |
| Order stuck in Pending | Open the order in the admin (that re-checks it). If the buyer never paid, the order moves to Canceled once the checkout expires and the next re-check runs. Check the cron URL is being called. |
| VEX Pay doesn’t appear at checkout | The method only shows when it is enabled, has a key, the buyer’s currency is one you chose (USD or VES) and the total is within your limits. A store in EUR, for example, never sees it. |
| The settings page says the build doesn’t match | You installed the build for the other OpenCart branch. Uninstall it and install vexpay.ocmod.zip on OpenCart 4.0.2+ or vexpay-oc3.ocmod.zip on OpenCart 3.0.4+. |
| Installed the 4.x zip on OpenCart 3 and nothing appeared | OpenCart 3’s installer accepts the file but finds nothing to install. Install vexpay-oc3.ocmod.zip instead. |
Uninstall
Extensions > Extensions > Payments > VEX Pay > Uninstall hides the method and removes its event. Past orders keep their history lines, and the vexpay_payment table stays so their VEX Pay references and payment ids are not lost. Your payments stay in your VEX Pay portal. If you no longer use the store, remove its webhook endpoint from your VEX Pay account.