PrestaShop module
Accept VEX Pay in a PrestaShop 8.1–9.x store: the buyer pays on the VEX Pay checkout and the order follows the payment on its own.
What the module does
PrestaShop 8.1–9.x: vexpay-0.1.0.zip. The module is new: try it with a Test key before you take live payments. A PrestaShop Addons listing comes later.
For PrestaShop stores and the developers who run them. The module adds one payment option, VEX Pay, at checkout. The buyer is sent to the VEX Pay hosted checkout, which offers every method you have enabled on your account, and comes back to the store. No card or bank data touches your store. The PrestaShop order then follows the payment by itself: VEX Pay notifies the store, and the module re-checks orders on its own when a notification is lost.
| Supported | Versions |
|---|---|
| PrestaShop | 8.1, 8.2 and 9.x (multistore included) |
| PHP | 8.1 or later, with the cURL extension |
| Currencies | USD and VES carts (VES carts are charged the exact bolívar amount) |
| Not supported | PrestaShop 1.7 and 8.0: the install is refused with “VEX Pay requiere PrestaShop 8.1 o superior” |
For business owners: a short overview of the PrestaShop integration, in Spanish, at vexpay.app/prestashop-venezuela.
Requirements
- A VEX Pay account. To take real payments it must be approved for live mode (see Going live); a Test key works before that.
- An API key from the portal: a Test key to try the module, the Live key when you are approved.
- The payment methods you want to offer, enabled on your VEX Pay account. The checkout shows only those.
- A public https address for the store, so VEX Pay can send it payment notifications. A store on localhost still works, with the re-checks described below.
Install
- Download the zip
Download vexpay-0.1.0.zip (PrestaShop 8.1–9.x). Don’t unzip it: PrestaShop takes the zip as it is.
- Upload it
In the back office: Modules → Module Manager → Upload a module, and choose the zip. The module creates its order state “Esperando pago VEX Pay” and its own table.
- Configure
Click Configure on VEX Pay, paste your API key and save (next section).
- Check the payment option
Add a product to a cart in USD or VES and go to checkout: VEX Pay appears among the payment options.
Configuration
| Setting | What it does |
|---|---|
| API key | Your VEX Pay key, Test or Live. It is checked with VEX Pay when you save; a key VEX Pay rejects is not saved (“La clave de VEX Pay no es válida”). After saving, the page only shows it masked; leave the field empty to keep it. |
| Title | The name of the payment option at checkout. Default: VEX Pay. |
| Currencies | USD, VES or both. VEX Pay is shown only for carts in a chosen currency. |
| Minimum / maximum total | VEX Pay is shown only for carts within these totals. Empty means no limit. |
| Cron URL | Shown on the page with its secret token. See “Re-checking orders” below. |
- Test vs live: a Test key creates test payments only; nothing is charged. Switch to the Live key when your account is approved. Saving a Live key before approval is accepted with a warning, and checkouts fail until VEX Pay approves the account.
- Notifications are registered for you: saving a valid key registers the store’s notification address with VEX Pay (
/module/vexpay/webhook) and keeps its signing secret. Saving again updates the same registration. If you change the key, a new registration is made for the new account. - Store on localhost or a private address: registration is skipped and the page tells you so. Orders are still updated when the buyer returns to the store or when you open the order. Save again once the store has its public https address.
- Multistore: pick one shop in the shop selector before configuring. Each shop has its own key, notification registration, secret and cron URL, so two shops can belong to two different VEX Pay accounts.
How a payment flows
- The buyer chooses VEX Pay
The order is created in the state “Esperando pago VEX Pay” (so stock is reserved), and one VEX Pay checkout for the order total. Clicking twice reuses the same order and checkout.
- The buyer pays on VEX Pay
With any method enabled on your account. Some methods can take minutes to confirm; the order waits meanwhile.
- VEX Pay notifies the store
A signed
payment.*notification moves the order and adds a private message with the VEX Pay payment id and method. - The buyer comes back
The order confirmation page shows the order’s current state. Returning never marks an order paid by itself: the module asks VEX Pay.
| VEX Pay | PrestaShop order state |
|---|---|
| Checkout created, not paid yet | Esperando pago VEX Pay |
| Payment pending | Stays in Esperando pago VEX Pay |
| Payment completed | Payment accepted (PrestaShop sends its usual email) |
| Paid less than the total | Payment error, with a private message giving the amount received |
| A try failed while the checkout is still open | Stays waiting: the buyer can try again |
| Failed or canceled once the checkout closed, or the checkout expired unpaid | Canceled |
| Payment reversed | Refunded |
| Paid after you canceled the order | Stays Canceled, with a private message and a log entry so you can reactivate it or return the money |
A late or repeated notification never moves an order back: a “pending” that arrives after the order was accepted changes nothing, and the same notification twice is applied once.
Re-checking orders (cron URL)
PrestaShop has no scheduler of its own, so the module gives you a cron URL: https://your-store/module/vexpay/cron?token=… (the configuration page shows the exact URL with your token). Call it every 10 minutes from your hosting’s cron. Each call re-reads up to 50 orders of that shop that are still waiting and have been quiet for 10 minutes, and applies any change exactly like a notification would. A wrong token gets 403.
*/10 * * * * curl -fsS "https://your-store.example/module/vexpay/cron?token=YOUR_TOKEN" > /dev/nullWithout cron, orders are still corrected: the module re-checks an order when the buyer returns to the store and when you open the order in the back office (at most once a minute per order).
Refunds
- Use PrestaShop’s refund on the order (Standard refund or Partial refund). The credit slip is always created in PrestaShop.
- Full refund of a method VEX Pay can reverse: the payment is reversed in VEX Pay automatically, and the order gets a private message with the reversal id.
- Partial refunds and methods VEX Pay can’t reverse: no money moves in VEX Pay. The order gets a private message saying the money must be returned by hand, and an entry in Advanced Parameters → Logs flags it.
- Reversal refused: the back office shows an error, the order gets a private message and a log entry, and the credit slip stays (PrestaShop can’t undo it). Return the money another way or contact VEX Pay support.
- A reversal done from the VEX Pay portal is mirrored on the order (Refunded) the next time it is re-checked.
Troubleshooting
| Symptom | What to do |
|---|---|
| “La clave de VEX Pay no es válida” | Copy the key again from the portal (Test or Live), with no spaces. A revoked key is rejected too. |
| Notifications don’t arrive | The store must be on a public https address. Save the configuration again to register it; check the endpoint and its deliveries in the VEX Pay portal. Your firewall or maintenance mode must let POSTs to /module/vexpay/webhook through. |
| Order stuck in Esperando pago VEX Pay | Open the order: the module re-checks it. Set up the cron URL so it happens without you. If the buyer paid part of the total by Pago Móvil, the order waits for the rest. |
| VEX Pay doesn’t show at checkout | The cart currency must be USD or VES and chosen in the settings, the total within your limits, and the key saved for that shop. Also check Payment → Preferences: the module must be allowed for the currency, country and carrier. |
| “VEX Pay requiere PrestaShop 8.1 o superior” | Update PrestaShop to 8.1 or later (and PHP to 8.1 or later). |
Uninstall
Disable or uninstall the module from the Module Manager. Uninstalling removes its settings (keys, secret, cron token). Past orders keep their states and messages, and the “Esperando pago VEX Pay” state and the vexpay_payment table stay for history. Payments already made stay in your VEX Pay account. Delete the notification endpoint in the VEX Pay portal if you won’t reinstall.