Notice
Also available on PrestaShop Addons, the official PrestaShop marketplace. View the module on Addons
Block duplicate orders and misdirected payments in PrestaShop
- One year of technical support and lifetime updates; from the second year, support is extended for €32.34/year and includes taking on your general improvement ideas for the module.
- Renews automatically; cancel whenever you want, with no minimum term.
- One year of technical support and lifetime updates; after that, support ends (with the subscription it is extended for €32.34/year).
- A single payment, with no automatic charges.
Prevent duplicate orders, resulting in two invoices or two payments when the payment gateway or status change occurs twice simultaneously. And fix existing duplicates in your store by returning trapped stock.
Compatible with PrestaShop 1.7.6 to 9.x. No overrides.
Orders
The customer paid once. Your store has two orders.
Two payment gateway notifications arrive simultaneously, both asking if the order exists before either has created it, and two are generated: each with its invoice, payment, and deducted stock. No standard check detects them because both appear to be working correctly internally. RKR Order Guard causes the second notification to wait.
/ It prevents it before it happens
And fix the ones you already have
In Orders → Duplicate Orders, you can review the entire history, not just orders placed after installation. Each duplicate cart is categorized according to the recorded payments:
The screen tells you which order will be kept and why, and lets you change it. The surplus is marked as Cancelled—it's never deleted—and stock is measured before and after, so you only replenish what hasn't been returned. You can simulate first: the trial counts exactly the same as the actual execution.
What it never does : issue a return or call the payment gateway; modify an order for which a package has already been shipped; remove an already numbered invoice that requires a correction; or execute anything in batches without you selecting the groups and confirming. And if the blocking process runs out, the sale continues anyway: the module never cancels an order.
It alerts you to what it finds
It detects four problems —duplicate order, duplicate invoice, overcharge, and unbalanced order— and records them in an incident log that is retained even if you uninstall the module.
And make sure nobody diverts your payments.
An attacker with FTP access to a legitimate store inserted their own payment gateway into the payment module. Orders were created using the legitimate module's name, appeared as normal payments in the back office, and the money went to someone else. For months, no one noticed because nothing appeared amiss in the back office. Order Guard sees what the back office doesn't show, operating in two layers.
What it doesn't do : it doesn't process any orders or payments, it only alerts you. It's a trace, not proof: each suspicious order is confirmed by looking up its transaction number in the payment gateway's dashboard, where fraudulent transactions don't exist. And it doesn't check Redsys for you: that verification is done manually in your merchant's dashboard, using the list on the screen.
Compatible with PrestaShop 1.7.6 to 9.x
Developed and maintained by REKIRE
v1.6.0
- New, disabled by default: "Check the carrier for cash on delivery orders." Neither PrestaShop nor the cash on delivery module (e.g.,
codfee) checks the carrier again when creating the order, so a customer who changes carriers while the payment page is open in another tab pays cash on delivery with a shipment that doesn't support it and without the surcharge. With this option enabled, orders from one of the selected modules whose carrier (by reference) is not on the list go into the chosen review status (no email to the customer), an alert appears in the red bar and in "Payment Monitoring" until someone reviews it, an email notification is sent if there is an address, and this is noted on the order details. The check is performed aftervalidateOrder()has finished (actionValidateOrderAfterin versions 8 and 9; at the end of the request in version 1.7). Seen in Northwest Adventure, order 22062 (codfee with NACEX_40). - It includes what was prepared as 1.5.2, which was not published on its own (below).
v1.5.1
- CoreWAF's automatic updates no longer trigger alerts. CoreWAF used to rewrite the root's
_waf.phpevery time it updated itself, and file monitoring interpreted this as tampering (resulting in a red flag in the back office). Now, the root's fingerprint stores the CoreWAF version, and if the only change is to_waf.phpand itsCOREWAF_VERSIONhas increased, the fingerprint is rewritten and recorded in the log, without triggering an alert. If_waf.phpchanges without a version update, or if something else in the root changes simultaneously, alerts are still issued as before. - The fingerprints taken with previous versions indicate the CoreWAF version upon update, provided the file is still the same as the fingerprint file. If the version has already changed, the open alert closes with "Accept current files," and subsequent CoreWAF updates will no longer issue this warning.
v1.5.0
For stores whose invoices are handled by another program, with no invoice status. In PrestaShop 1.7.6 and from version 9.1 onwards, when creating a delivery note for an already paid order, a second payment for the total was recorded: it's not a second charge to the customer, but the order shows double the amount paid.
- New option, "Keep one payment" (off by default): links the existing payment to the delivery note, and PrestaShop stops recording another one. An order without a payment yet, such as a bank transfer, continues to record its own payment. It does not affect previous orders.
- The warning, which indicates the cause of the issue , appears in a back-office banner and on the module screen, but only if the PrestaShop has the fault. This does not occur in versions 1.7.8, 8.2, and 9.0; the screen only warns users who are about to update to version 9.1 or higher.
v1.4.2
- The Redsys signature is also checked against the modules that store the key in their terminal table (
redsys_tpv, a third-partyredsys4.x module). Previously, only the configuration was checked, so with that module, no signature was verified, and a forged notification appeared as a charge without an order, generating an alert. Now, it's treated as a mismatched signature: it doesn't count as a charge and doesn't trigger an alert. If the table doesn't exist or belongs to another module, there's no issue. - A notification without a signature is no longer acceptable : if the store has keys, it counts as a signature that doesn't match.
- A false notice cannot take the place of the real one : if it is sent first with the same transaction number, the authentic notification replaces it.
- The "Create order" option requests confirmation if there is no proof of payment. If the signature is unverified and there is no CSV line, you must select "I saw it on the Redsys portal"; otherwise, the order will not be created.
- Parameters with
+: the signature is calculated correctly even if the+in base64 arrives as a space. - No PHP module failure can stop an order. The hooks running inside the notification and
validateOrder()also catchErrorandTypeError, not just exceptions. - The cron job no longer ends in a 500 error. It was doing its job and responding with the JSON, but then PrestaShop tried to render a template that doesn't exist: a Smarty fatal error and a 500. Adding
&ajax=1to the URL is no longer necessary (if it's already there, it still works).
v1.4.1
- "Create order" no longer changes the screen language. Creating an order for a single payment without a pre-ordered payment would leave the back office in the customer's language (and with their cart and currency displayed) until the next page. Now, everything returns to its original state.
- Tweaks for the PrestaShop Addons validator: the orderless payments store is passed from the module and controller instead of reading it from the global context, and the two-comment style is adjusted to PrestaShop standards.
v1.4.0
Redsys payments that never resulted in an order. The bank charges, Redsys notifies, and the order isn't created: the notification arrived, but validateOrder() ` failed, timed out, or never arrived at all. The customer paid, and the store is unaware of it.
- This log records every Redsys notification that enters the store, captured by the dispatcher before the payment module's driver loads (if the driver crashes, the entry is already recorded). It applies to any module that receives
Ds_MerchantParameters: the official one, RKR Redsys, the integrated Redsys module in RKR Subscriptions, or a third-party module. Only the information necessary to match it to an order is saved (transaction number, cart value, amount, currency, response, type, authorization); never the card details or the parameters themselves. - Signature verified (HMAC_SHA256_V1 and HMAC_SHA512_V2) against all Redsys keys in the configuration. Signature that doesn't match = does not count as a charge; without a key to verify, it counts but is marked as "signature not verified".
- The cron job (using the "Check Now" button) checks after a few minutes (15 by default, configurable) for each authorized payment—by transaction number in the checkout, by cart, or, in "create order before paying," by ID—and records
payment_without_orderorpaid_order_not_updated(the order exists but is still unpaid). It notifies users via email and RKR Sentinel, and updates the red bar in the back office. If the order appears later, the alert closes automatically. - Import of the CSV file for transactions from the Redsys portal (Channels), for which the store never received data. Columns recognized by the header, in Spanish or English; separator
;,,or tab; UTF-8 or Latin-1; amounts "1.234.56" or "1234.56". Only authorized payments: denied, refunds, and cancellations are skipped. - "Redsys Payments without Order" screen (Orders): Create Order button (in "Payment Accepted", with the transaction number in the payment and the employee in the order message) only if the cart number is known, the cart still has no order, the currency is the one in the cart, and the amount charged is today's total; the payment module is selected from the active ones. It uses the same lock as the notification, so it doesn't overlap with a Redsys retry. Discard button for returned or manually resolved items, and the latest notifications are noted to verify that the record is working.
- If another module fails after the order is created (a hook in the confirmation email that expects the front-end pricing format, seen with
idxrrecargoe), the order is considered created and the failure is reported. Without the pricing format in the context, it is set before creation. - Switch and waiting time in settings. Notifications that already have your order are deleted after 180 days.
- The Redsys web service transaction inquiry feature is not available: the bank has to activate it separately and there is no way to test it.
v1.3.2
- The PrestaShop Addons product key (
module_key) is required to sell it there. Nothing else changes.
v1.3.1
- For PrestaShop Addons validators only: the module description must be a single line. If it's split across multiple lines, the validator won't read it and will fail "Requirements" with "$this->description is not valid". The text is the same, and the store doesn't notice anything.
v1.3.0
Monitoring of diverted payments. It stems from a real case: an attacker with FTP access inserted a card payment from their own payment gateway into the Redsys module, and for months orders were created under the Redsys name, with everything in order in the back office—including the module's own table—and the money in their account. Nothing new touches an order or a payment: it only records and alerts.
- New criterion
payment_mismatch: the transaction number is not the one the gateway would have written for that order. Validators per gateway (classes/RkrOrderGuardGateway*.php, one slot per gateway). Redsys is checked by signature : the actual Ds_Order starts with the cart number with zeros up to 8 digits and ends inmmss(or is the 12-digit order ID with "create order before paying"); it is respected whether it is a different cart or another order from the same customer, and empty or outdated formats are not considered. PayPal, PayPlug, and Stripe are checked by format . This is checked inactionValidateOrderand recorded once per order, not once for each status change. - Validated against the store's copy of the case (over 100,000 orders, checked in less than a second): exactly the diverted orders appear, none before the first day of the attack, and no false positives in the tens of thousands of PayPal and PayPlug orders. Legitimate Redsys accounts with 12 digits all have valid
mmss; random 12-digit accounts fail two out of three times. - Payment module file fingerprint (
payment_files): SHA256 hash of each code file in the installed payment modules—active or not (the attacker deactivated PayPlug to hide it)—as well as of this module and any loose files in the root directory. It alerts if a file changes, appears, or disappears. An PrestaShop update doesn't trigger a warning : it simply updates the version in the database, and the fingerprint is automatically rebuilt. The file version is invalid: the attacker installed an older version of the module. - New screen: Orders → Payment monitoring. Open alerts (marked as reviewed), files by module with "Accept current files" and review of transaction number history , read-only.
- Notifications are displayed as follows : a red banner across the entire back office while anything remains open, and a notification on the order details page , which is where the sender is located. In addition, there are email notifications and notifications via RKR Sentinel.
- Cron with its own token (
/module/rkrorderguard/cron): checks the files and orders from the last seven days, in case any were created without going through the hook. Without cron, the back office performs the file check at most once per interval. - What not to do : check the transaction with Redsys. The Redsys module doesn't include any queries, and Redsys is a separate service that each bank activates for each merchant. Confirmation is done manually in the control panel.
- Coexistence with RKR Order Guard Free, which shares the incident table and closes open items on an order that it considers clean: a diverted payment remains open until an employee marks it as reviewed, regardless of who closes it.
- PrestaShop 9.1 does not render
displayAdminAfterHeaderon classic controller pages: the banner is also placed fromdisplayBackOfficeHeader, without being duplicated. - Fixed a critical bug in PrestaShop 9 related to duplicate repair: restoring stock would call `
StockAvailable::dependsOnStock(), which version 9 no longer has. This error only occurred when the cancellation hadn't automatically restored the stock. - Addons recap: all HTML is routed to Smarty templates (
views/templates/admin/) and scripts toviews/js/; noContext::,Tab::getIdFromClassName()orModule::isInstalled()/isEnabled()(obsolete);.htaccessin the root;l()without Symfony's backup, which left "Translation not found" with "No" and "Total"; theconfig.xmldescription is the same as the PHP one; PHP CS Fixer and PHPStan (level 5) are clean.
v1.2.0
The flaw has a variant that version 1.1.0 didn't detect: when the payment module creates the order AFTER payment, what gets duplicated isn't the invoice, but the order itself . Each remains internally consistent—the invoice with its line items and its payment reconciled—so none of the three previous criteria flagged it. On a real store with 143,649 orders: 29 carts with two orders, and of the 54 most recent, version 1.1.0 would have flagged zero .
- New criterion
duplicate_order: There is another LIVE order from the same cart with a different reference. The reference is what distinguishes it from a split by package, which PrestaShop does intentionally and in which all orders share the same reference—therefore, a unique index onorders.id_cartis not the array. This is checked inactionValidateOrder, which is when it is known that an order has just been created, and in each subsequent check. - New screen: Orders → Duplicate Orders. Review and fix those already in the store, which until now had to be done manually one by one. It doesn't look at
RKROG_SINCE: that date is for live monitoring, and this is precisely the place to see the previous one. - The classification is the important part of that screen , and it comes from
order_payment.transaction_id, which is core and doesn't depend on the payment gateway: A is one payment and two orders—the excess is canceled, there's no extra money—, B is two separate payments—money needs to be refunded, and that's decided by a person—, and C is undetermined, which is only listed. Only case A is modified. - And what it doesn't do, which is equally important : if the surplus has a numbered invoice, the invoice is not touched (that requires a correction), if a package has been sent out, nothing is touched, the gateway is never called nor is a return issued, and nothing is executed in batches without marking and confirming it.
- Simulating counts exactly the same as executing. The entire decision resides in
analizar()`, which doesn't write anything;aplicar()only executes what has already been decided. The report balances by construction (grupos = reparados + saltados + sin nada) and the screen warns if it ever doesn't balance. - Stock is measured, not assumed. The core system returns stock upon cancellation, but only if the previous state was relevant and the product isn't handled through advanced management. Stock is measured before and after, and only what hasn't been returned is replenished: adding stock just in case would result in a double return, which is worse than not returning it at all.
- The gateway reference becomes the FIRST lock key. On a server that only allows one
GET_LOCKper session, only the first key is used, and with the shopping cart in front, the two gateway calls were locking different names: zero mutual exclusion, and the module was installed, active, and doing nothing. The gateway reference is the only one that arrives via both paths—the server-to-server notification usually comes without any of our parameters. - Optional logging of taken locks (
RKROG_TRACE, factory disabled). Without it, discovering the above takes an afternoon: there was no way to see which key had blocked a request.
You might also like
4 other products in the same category
Viewed products
You might also be interested in
Questions and answers
-
¿Cómo evita que un mismo pago genere dos pedidos?
0-
Antes de que el controlador del módulo de pago cargue nada, toma un bloqueo de MySQL: si llegan dos notificaciones de la pasarela a la vez, la segunda espera y, cuando entra, ya ve el pedido creado. También bloquea el pedido mientras cambia de estado, para que no salgan dos facturas ni dos cobros, y evita el doble envío del formulario de estado en el back office. Si el bloqueo agota su espera, la venta sigue: el módulo nunca corta un pedido.
-
-
¿Sirve para los duplicados que ya tengo en la tienda?
0-
Sí. En Pedidos → Pedidos duplicados revisa todo el histórico y clasifica cada carrito: un cobro y dos pedidos (cancela el sobrante y devuelve su stock), dos cobros y dos pedidos (lo decide una persona) o indeterminado (solo lo lista). Te dice qué pedido se quedaría y por qué, puedes cambiarlo y simular antes. El sobrante pasa a Cancelado, nunca se borra.
-
-
¿Hace devoluciones de dinero o toca facturas ya emitidas?
0-
No. Nunca emite una devolución ni llama a la pasarela, no toca un pedido del que ya ha salido un paquete y no retira una factura ya numerada, que necesitaría una rectificativa. Tampoco ejecuta nada en lote sin que marques los grupos y confirmes.
-
-
¿Qué es la vigilancia de pagos desviados?
0-
Comprueba que el número de operación de cada pedido tiene la forma que escribiría su pasarela: en Redsys por firma contra el carrito, y en PayPal, PayPlug y Stripe por la forma del identificador. Además guarda una huella sha256 de los ficheros de tus módulos de pago y te avisa si alguno cambia sin una actualización de PrestaShop. Solo avisa, con una banda roja en el back office y en la ficha del pedido; cada sospecha se confirma en el panel de la pasarela.
-
-
¿Usa overrides? ¿Qué versiones de PrestaShop admite?
0-
No usa ningún override, así que no toca el núcleo y sobrevive a las actualizaciones de PrestaShop y de tus pasarelas. Es compatible con PrestaShop 1.7.6 a 9.x.
-
-
¿Puedo tenerlo instalado junto a RKR Order Guard Free?
0-
Sí, conviven y comparten el registro de incidencias. Un aviso de pago desviado de este módulo sigue abierto hasta que un empleado lo marque como revisado, aunque la versión gratuita vea limpio ese pedido.
-
Customer reviews
There are no reviews yet. Bought it? Tell other customers what you think.
Reviews marked "Verified purchase" come from customers who bought the module on rekire.com or hold the Annual Pass, which includes all our modules: we match them with their order before publishing them. We publish positive and negative ratings alike; we only hold back reviews that break our rules (insults, personal data or advertising). See all the shop reviews