deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

Payment return URLs can mark orders paid without confirming the transaction

A dev.to post describes a checkout that trusted a redirect after 3DS, letting stale, declined or forged return URLs flip orders to paid; the fix keeps state changes to signed webhooks and server-side checks.

Payment return URLs can mark orders paid without confirming the transaction

A checkout that trusted the redirect

A post on dev.to by Payneteasy, a payments company, walks through a problem the company says it encountered while reviewing a checkout flow. The system under review updated an order to paid the moment the customer's browser landed on a success return page — /return?status=success — after completing a 3-D Secure (3DS) challenge. In testing, the setup looked correct: whenever the browser came back with a success flag, the gateway had in fact approved the payment. In production, the two signals drifted apart, and orders changed state on redirects that did not correspond to actual money movement.

Three ways the redirect diverged from reality

According to the post, the mismatch showed up in three distinct ways.

The first involved browser history. A customer could press Back during the challenge, then later reopen the return URL from their history. The order would flip to paid on that stale redirect, regardless of what had actually happened to the transaction.

The second exposed a gap between two steps that are easy to conflate. The bank's ACS — the server that runs the 3-D Secure challenge — confirmed the customer's authentication, but the authorization was subsequently declined by the issuer. Because the redirect only reflected the 3DS step, it still reported success, and the order was marked paid even though no funds had moved.

The third was the simplest: the query string lives in the browser and belonged to whoever held it. The reviewers showed on a test order that switching status=failed to status=success was enough to mark it paid, because the handler never verified a signature.

The lesson the post draws is that a return URL proves only that the customer's browser arrived back at your site. It carries no authority about what the gateway actually did with the transaction.

The fix: a read-only return page

The remediation described on dev.to separates presentation from state. The return page now displays a "checking your payment" message and never writes order state itself. Order state changes only through server-side channels: a signed webhook, or a server-to-server status lookup by transaction identifier used when the webhook is delayed. The page polls the merchant's own order status endpoint for roughly 20 seconds, and if the outcome is still unknown after that, it tells the customer they will be notified by email.

The post reports that after the change, the merchant stopped seeing both orders that shipped without payment and paid orders that were never fulfilled.

Why it matters

The pattern the post describes is common well beyond this one checkout. Return URLs are convenient, visible and easy to demo, which makes them tempting as a source of truth — but they run in the browser, they can be replayed from history, they can be edited by hand, and they only echo whatever the gateway chose to put in the redirect, which may reflect a partial step such as 3DS rather than the full authorization outcome. Treating them as confirmation turns a UI convenience into both a security hole and a revenue bug: goods ship without payment, or customers pay and watch nothing happen. The fix outlined in the post is a useful template for any e-commerce integration: render the return page without side effects, require signatures on webhooks, and fall back to a server-side status query by transaction id rather than trusting anything embedded in the URL. For developers building or auditing payment flows, the question the post closes with is worth asking of your own system: does the return URL touch order state at all, or is that strictly webhook territory?

  • #payments
  • #e-commerce
  • #security
  • #webhooks
  • #3d-secure

Related posts