Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

My customers get charged twice when they pay

Short answer

Two charges for one order usually come from a retried request, a double click, a repeated webhook or a customer paying again after a slow page. Stripe supports idempotency keys so that retrying a request does not perform the same operation twice. Check the payments in your dashboard before refunding.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • A customer shows two charges on their statement for one order.
  • Two paid orders appear with the same items within minutes.
  • It happens when the site is slow or the customer's connection drops.
  • Customers click Pay again because nothing seems to happen.
  • Refund requests for duplicate payments are increasing.

Why does this happen?

  1. A retry repeats the request

    If a request times out and is sent again without an idempotency key, the provider treats it as new. Stripe says an idempotency key lets you safely retry without performing the same operation twice.

  2. The customer pays again after a slow page

    If the page after payment does not load, the customer sees no confirmation and tries again. A second payment is then valid in the provider's view.

  3. Your site handles the same event twice

    Stripe says orders should be created from webhook events and the code must cope with the same event arriving more than once. If it does not, one payment can produce two orders or two emails, which looks like a double charge.

  4. A button can be pressed twice

    A Pay button that stays active while the request runs lets a fast double click send two payments.

  5. It may be two real payments or one payment shown twice

    A card issuer can show a temporary authorisation next to a captured payment. Only the provider's records show which is real.

What can I do about it today?

  1. Check the provider's payments listFind the customer's email or card ending and see whether two captured payments exist or one captured and one authorisation.
  2. Compare with your ordersDo you have one order or two? Two orders mean the site created a duplicate.
  3. Refund a real duplicateRefund the extra payment in the provider's Dashboard, and tell the customer when to expect it. Refund timing is decided by their bank.
  4. Write down the detailsTime, amount, order number and what the customer did. Your developer needs these.
  5. Do not change the payment code yourselfA quick edit to payment code can create new double charges.
  6. Check for other duplicatesSearch the same day for other matching amounts from the same customer.

When should I bring someone in?

  • It has happened more than once.
  • Duplicates correlate with slow periods, deploys or a payment provider outage.
  • You cannot tell from your records which payments belong to which order.

How do I handle it?

  1. Find the exact pathI trace a duplicate through browser, server, provider and webhook to see where the second action started.
  2. Add idempotency to payment requestsEach payment attempt carries a key tied to the order, so a retry returns the first result.
  3. Make the confirmation page and webhook safeEach event is recorded once, and an order is created at most once per payment.
  4. Block double submitsThe button is disabled while the request runs, and a clear waiting state is shown.
  5. Add a daily duplicate checkA simple report flags two payments for the same order or customer so you find them before the customer does.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Is one of the charges always real?

Not always. A pending authorisation can sit beside the real charge. Check the provider's records before you refund.

How long does an idempotency key last?

For Stripe API v1, keys can be removed automatically once they are at least 24 hours old.

Will a refund fix it for good?

A refund fixes that customer. The cause is in the retry, double-click or duplicate-event handling and needs its own fix.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.