Payment Charged Twice for Single Order

The client was billed twice for the same cart. A refund is mandatory, but isolating which tier duplicated the transaction is critical — patching the wrong layer allows duplicates to persist.

Urgency: Critical · chargeback risk · Category: Orders & Payments

Field Observations

Moments after clicking purchase, the customer receives two consecutive bank deduction alerts. Only one order number appears in the dashboard; the customer reports double billing and files a chargeback with their bank.

Observed System Error Signatures

  • Two successful charges with identical payment reference
  • Webhook logs: identical event ID processed twice
  • App logs: two submissions, same second, same session
  • Payment gateway dashboard shows no duplicate transaction alert

Gateway transaction IDs and internal order tokens are distinct. Which one is duplicated indicates whether concurrency stems from client UI or webhook replays.

Three Potential Root Causes & Differential Tests

A · Client double submit

Submit button was not disabled on click; slow response caused user double-click.

Differential test: Did both requests originate from same session?

Evidence: Two posts, same session → A

Resolution: Button lock + idempotency key header

Common anti-pattern fix: Disabling the button via JavaScript alone fails because submitting via the Enter key bypasses frontend guards without backend idempotency.

B · Webhook redelivery

Gateway redelivered standard retry callback. App treated both as novel transactions.

Differential test: Was same event ID executed multiple times?

Evidence: Same event ID processed twice → B

Resolution: Record event ID · ignore duplicate callbacks

Common anti-pattern fix: Increasing gateway timeout thresholds fails because the webhook handler still processes duplicate payloads without checking transaction references.

C · Blind client retry

App got network timeout and blindly retried transaction, unaware first attempt succeeded.

Differential test: Did first attempt experience read timeout?

Evidence: Retry after timeout → C

Resolution: Safe retry logic · reuse identical idempotency key

Common anti-pattern fix: When users press the browser back button, the session executes again; lacking single-use verification tokens allows the bank to reauthorize.

Who resolves it

Backend engineer. Scope, timeline and budget become clear after diagnosis. The root solution for all three is strict idempotency: ensuring identical payment attempts return identical cached results without multiple charges.

Impact If Left Unresolved

Refunds settle double charges but merchant processing fees and customer trust are permanently lost. Gateway risk algorithms penalize high chargeback accounts.

Related Concepts & Services

→ Emergency Incident Triage & Crash Test

Trend Master Akademi Studio & Labs

B2B White-Label Engineering Desk | Tel: +90 534 371 35 73 | Email: info@trendmasterakademi.com

Address: Akdeniz Mah. Sehit Fethibey Cad. Heris Tower No: 55 Ic Kapi No: 091 Konak / Izmir