All articles

Which version of the order did the customer pay for?

An order can change while payment is running. Keep the customer’s confirmed purchase, final shipping and tax calculation, and original payment attempt tied to the same version.

In this article

A shopper chooses standard delivery and submits payment. While the request is running, an older browser tab changes the order to express delivery. The gateway returns a successful result for the original amount. The order screen now shows the more expensive delivery choice.

In this hypothetical store, the card connection can be working correctly while the purchase is wrong. The customer approved one version, the gateway received that version’s amount, and the merchant is preparing to fulfill another.

The question is no longer whether payment succeeded. It is which purchase the result belongs to.

Keep the purchase that was actually submitted

A shopping cart is editable by design. A submitted payment instruction needs a stable meaning. Ask the developer how the application connects each attempt to the items, quantities, applicable adjustments, delivery choice, amount and currency the customer confirmed.

The store’s current total is not necessarily the submitted total. Nor is matching the amount enough when two different products or delivery arrangements cost the same. The business needs the agreed purchase as well as the number sent to the gateway.

OWASP recommends calculating trusted totals on the server and matching the verified payment result to the expected order, amount and currency. For the merchant reviewing a custom integration, the practical extension is to ask which saved order version supplies that expectation. Reading whatever happens to be in the cart when the response arrives can answer the wrong question.

This does not mean every shopping change needs an extra confirmation page. It means the customer must be able to understand the purchase being submitted and the application must preserve it. W3C’s error prevention guidance allows several approaches, including review and correction, rather than prescribing one additional screen.

A late calculation needs a decision before payment

Shipping and tax services can respond after the customer has made another choice. Suppose a delivery estimate was requested for the first address, then returns after the customer enters a second. Accepting the newest response to arrive would be a mistake if it describes the older address.

Have the team tie each calculation to the purchase inputs it used. A stale answer should not overwrite the current quote merely because it arrived last. When a required calculation is still unfinished, the checkout needs an honest waiting or correction state rather than treating the missing amount as zero.

The commercial decision belongs to the merchant too. If the store deliberately offers a fixed shipping charge or absorbs a difference under an approved policy, make that policy explicit. That differs from accidentally letting an unfinished quote decide what the customer pays.

Tax needs its own agreed calculation and rounding treatment. The point here is the timing of the accepted amount, not a universal tax rule. The order should retain the result used at submission. A later recalculation must not quietly rewrite what the customer already confirmed.

A resumed cart deserves the same review. A saved link can recover the shopper’s choices without preserving yesterday’s price or delivery availability. Present material changes before a fresh submission. If an earlier payment is still unresolved, investigate that attempt before turning the resumed cart into another collection.

An edit cannot silently replace an operation in progress

Decide what staff and shoppers may change while an attempt is running. The store can defer a consequential edit until the result is resolved, or retain it as a separate proposed revision. What it cannot safely do is overwrite the submitted purchase and let the returning result mark the replacement paid.

Disabling a button helps explain the state to the person on that screen. It does not coordinate another tab, a staff order editor or a background job. The application must enforce the agreed sequence where those routes meet. OWASP’s transaction authorization guidance specifically addresses protecting significant data against modification between confirmation and execution.

Once a request has been sent, invalidating the local checkout screen does not cancel the remote operation. Preserve the attempt and establish its result. If the customer still wants the revision, use the supported amendment, additional collection or return process appropriate to that result. Our paid order amendment article follows that later decision.

The response may also arrive after support has started investigating. It should complete the history of its own attempt, not erase a newer customer request or trigger a second parcel. Staff need both the financial state and the current customer agreement to decide what happens next.

Test the order of events, not only the final amount

A fast test purchase lets every dependency finish in the expected order. Ask the team to slow the shipping response, change the address while tax is calculating, edit the cart from another tab and return to a saved checkout. Use the supported test environment and inspect the purchase that actually reached the payment request.

Then delay the payment result and try a staff amendment. The demonstration should show which changes wait, which are rejected for review and how the verified result remains connected to the original purchase. A tidy total after everything settles can hide an incorrect amount submitted earlier.

For Trolleys merchants, include these cases in the web team’s customer journey checks. The gateway handles the supported payment instruction; your store remains responsible for deciding which instruction represents the customer’s purchase.

Keeping checkout responsive is worthwhile. Letting the meaning of the purchase change after the customer commits is a different kind of speed.