Skip to content

Payments, billing and compliance

An approved payment is not a reconciled order: prevent duplicate fulfillment

Check payments and prevent duplicate shipments, with Wompi and Stripe as references. Includes a synthetic example, a test matrix and practical checks.

In this guide
A hand sticking a single blank label on a sealed box between two identical receipts, on a packing table lit in green.

Imagine a customer paying on their phone, closing the tab, and messaging your team on WhatsApp because no confirmation arrived. Your team finds the charge and marks the order as paid. Minutes later, the integration processes the same purchase again and authorizes another shipment.

The problem is not a missing payment. It is a system acting twice. This guide explains what to check when connecting a payment gateway to your business’s orders, regardless of who built the system. Keeping payments, orders, and shipments separate helps prevent a repeated notification from triggering another delivery.

1. Keep orders, payments, and shipments separate

An order records what you agreed to sell. A payment attempt records an operation with the gateway: a buyer may have a declined attempt followed by an approved one for the same order. Shipment means the goods leave your business; authorizing it does not mean they have been delivered.

Give each order its own number or reference before the customer starts paying. Keep the references for its payment transactions and record shipment authorization separately. The buyer’s email address is not enough to link them: one person can place several orders or try paying more than once.

In this guide, a “reconciled order” means the approved payment matches the expected order and has been credited to it once. It does not mean the funds have reached your bank account or that accounting reconciliation is complete. Nor does it mean you have a valid invoice. Those are separate checks.

2. The confirmation page does not replace payment verification

After a payment attempt, the browser may take the buyer to a confirmation page. This redirect helps explain what happened, but it should not be the only signal authorizing shipment: the customer may close the tab or lose their connection.

The gateway can notify your system through a webhook: an automatic notification sent directly to the server, without depending on the buyer returning to the page. Wompi’s event documentation describes these notifications when a transaction changes status. If the receiving system does not return the success code 200, Wompi retries delivery under the conditions in that documentation.

Receiving another notification therefore does not prove there was another purchase. While checking the payment, you can display “We are verifying your payment” rather than mark it declined or approved without evidence. If the customer sends a screenshot on WhatsApp, use it to investigate, not as a substitute for checking with the gateway. Check the previous attempt before asking them to pay again.

3. Check where the notification came from and which order it belongs to

A notification’s signature is a security check that helps verify its origin and the integrity of the data it protects. It does not, by itself, prove that the payment belongs to the order you are about to ship.

Wompi documents a verification procedure using the data specified in the event, its timestamp, and an event secret that must remain secure on the server. The data used can vary, so the technical team must follow the current procedure rather than assume a fixed list. The event secret is also different from the gateway’s access keys. None of these should be copied into chats, spreadsheets, or diagnostic logs.

Next, match the transaction to the order: reference, status, currency, and expected amount, within the correct merchant account and environment. The environment distinguishes test transactions from real payments. Compare amounts using the gateway’s units: an amount in cents cannot be compared directly with one in pesos.

Do not assume the signature protects every field you receive. If a required detail falls outside its verification, check it through an official query from your server to the gateway before using it to authorize shipment. If information is missing or does not match, keep the order on hold and assign someone to investigate. Changing a reference to make it fit hides the discrepancy instead of resolving it.

4. Receive the notification again without repeating the shipment

Idempotency means repeating the same operation does not produce a second effect. Here, recording the same payment again should not deduct inventory again or authorize the same shipment twice.

Two related controls are needed. One recognizes repeated notifications using the data each provider supplies; not every gateway provides a unique event number. The other protects the action on the order, even when different notifications concern the same payment. Stripe’s webhook guide documents both duplicate events and delivery in a different order from their creation. These are Stripe’s rules and should not automatically be attributed to Wompi.

Ask your technical team to ensure the control survives a restart and works when two processes receive the notification at the same time. Having both check whether it was already processed is not enough: both could read “no” before either records it. The system must ensure only one can record that authorization and that the shipping system does not execute it twice either.

An older notification arriving after a newer one should not automatically move an order from “paid” back to “pending.” A later refund or void still needs its own handling. The rule is not to ignore everything after payment approval, but to check which change should apply.

5. Decide what can proceed and what needs review

This table turns the checks into decisions about the order. It is not a catalog of Wompi or Stripe statuses: your team needs to map it to the provider’s actual statuses.

Order decisions
SituationDecisionEvidence
Payment pendingDo not authorize shipmentTransaction and latest status check
Approved payment that matches the orderRecord the payment once and check whether shipment can proceedVerification and payment record on the order
Repeated notification for an already recorded paymentRecord receipt without repeating actionsTransaction details and previous outcome
Invalid signature or wrong environmentDo not use the notification as payment confirmationRejection reason, without secrets
Approved payment with a different amount or referenceKeep the hold and investigateDiscrepancy and person responsible
Another approved payment for an already covered orderReview the possible overpayment without another shipmentBoth transactions and an authorized decision

The payment and fulfillment test matrix contains scenarios for testing these decisions and recording evidence from each test. It is a template, not a record of completed tests. You can document the connections with the systems and data-flow map to clarify where each confirmation is received, recorded, and used.

6. Test what happens when payment is recorded but the response is lost

Synthetic example: this is not a customer case or a claim about RealStack results. A distributor receives a COP 238,000 payment for an order of the same value. Security verification and a query to the gateway confirm that the transaction matches the order. The system records the payment and authorizes shipment, but the response acknowledging receipt of the notification is lost.

When the notification arrives again, the system recognizes the recorded payment. There should be two notification receipts, but only one payment record and one shipment authorization. If two processes receive it simultaneously, the expected result is the same. This is a concrete acceptance criterion you can agree on with your provider; the guide to requesting a software improvement without scope creep helps you document it.

Now change one condition: another approved transaction appears for the same order. This is another payment, not a repeated notification. Because the order is already covered, the sales and finance teams need to review it. It should not trigger another delivery or an automatic refund without the necessary rules and authorization.

7. Acknowledge receipt without losing unfinished work

Telling the gateway “received” and finishing order processing are separate steps. Before acknowledging receipt, the system should store the validated notification persistently: it should survive a process restart. A reliable work queue allows processing later without keeping the gateway waiting while emails are sent or inventory is checked.

If storage fails, do not confirm that the notification has been safely received. If it was stored but the next step fails, the work must be recoverable without repeating completed actions. This is a design criterion to check with your team, not something the gateway handles for you.

The response also depends on the provider: Wompi documents code 200; Stripe requires a quick successful 2xx response before complex work. Follow each provider’s rules.

Stripe also documents idempotency keys for API requests. An API is the interface other systems use to communicate with Stripe. These keys identify retries of a supported operation. This protection has conditions that depend on the API version. It is not indefinite and does not, by itself, cover incoming notifications, inventory, or your business’s shipments.

8. Review payments that are still missing from orders

Once controls are defined, you need to spot unfinished work. Review how many approved payments have not yet been recorded against their orders, how long they have been waiting, and whether any shipment actions were repeated. Count payments and orders separately: the number of notifications received is not the number of sales.

Agree on a review deadline with your team based on payment methods and support hours. Each exception needs a person responsible, a status check, and a recorded decision. WhatsApp can support the conversation, but should not be the only place where that decision is recorded. To place these responsibilities in the wider operation, see the guide to connecting customer management, inventory, and invoicing.

Before enabling the workflow

Use this list to complete the review after checking the test scenarios:

  • ☐ Orders, transactions, and shipment authorizations have separate, linked references.
  • ☐ Test payments are separated from real ones, including notifications and credentials.
  • ☐ Payment authenticity and its match to the order are verified.
  • ☐ A repeated notification does not duplicate actions, even when two processes receive it simultaneously.
  • ☐ Another real payment for a covered order triggers a review, not another automatic delivery.
  • ☐ Stored work can be recovered after a crash without repeating completed actions.
  • ☐ Someone is responsible for reviewing approved payments not yet recorded against orders.
  • ☐ Records support investigation without exposing secrets or unnecessary personal data.

What payment confirmation does not settle

Confirming and recording payment is only one part of a sale. Inventory availability, partial deliveries, returns, and invoicing need their own rules. If you accept deposits, define how much of the balance each payment covers: a deposit does not mean the order can ship. These controls alone do not eliminate fraud or chargebacks, meaning disputes over card charges.

Bring it to your business

Systems and Data Flow Map

CSV template to map systems and data flows: which data travels, from which owning system, to where, with what trigger and frequency, how it is reconciled and what happens if it fails. Useful to prepare an integration without duplicating information.

View resource

Bring it to your business

Payment and fulfillment test matrix

CSV template for testing how payments are recorded and when shipment is authorized. Compare expected and observed results using specific records and an assigned reviewer.

View resource
Does a notification of an approved payment mean I can ship immediately?

Not by itself. First verify its authenticity and that the payment matches the order. Then check inventory, delivery terms, and risk controls: they may prevent shipment even after payment approval.

What if the customer paid but never returned to the page?

Check the transaction through the gateway’s official mechanism and review received notifications. Do not ask the customer to pay again without checking the previous attempt and linking it to the order.

Do two notifications mean two payments?

Not necessarily. Check whether they refer to the same transaction. If they concern two different approved transactions for an already covered order, review the possible overpayment without automatically authorizing another delivery.

Does the gateway’s idempotency protect my inventory too?

Not by itself. That protection depends on the operations and conditions the provider documents. Your system must separately control inventory reservation, payment recording, and shipment authorization.

Authorship and sources

Author: Andrés Florez