Resources · 47
Uncertain payments: recover checkout without duplicate orders
Reconcile network delays, browser returns, notifications and business state instead of treating any one signal as sufficient.
· 4 min
What this guide helps achieve
- Separate attempt, payment and order
- Handle delayed or missing returns
- Deduplicate notifications and requests
- Explain uncertainty without asking users to pay again
Quick check
- Which source confirms payment?
- Does closing the browser change business state?
- Does a repeated event prepare two orders?
- Are event signatures checked?
- How does support find an uncertain operation?
Step-by-step method
- 01
Define the states
Separate cart, attempt, authorisation, confirmed payment, order and refund. Write transitions, authoritative source and permitted actions. Follow the actual provider and payment methods; not every method confirms immediately.
Deliverable: state diagram and business contract.
- 02
Identify the operation
Connect an attempt to an order and provider identifiers. Use the documented idempotency rule for repetition of the same operation. A new purpose or changed parameters needs an explicit decision rather than blind key reuse.
Deliverable: stable identity and recovery rules.
- 03
Handle the browser return
Display state from a server-side check appropriate to the provider. A redirect to a success page alone is not payment evidence. Cover a closed browser, missing return, interrupted authentication and slow network.
Deliverable: return journey and messages by state.
- 04
Verify notifications
Check authenticity according to provider documentation, record event identity and handle repeats without duplicate effects. Events can be late or out of order. Where needed, retrieve the reference object before an irreversible transition.
Deliverable: tested handler and bank-data-free traces.
- 05
Reconcile discrepancies
Compare provider operations, orders and fulfilment. Isolate paid-without-order, order-without-confirmation, double processing and unpropagated refunds. Give each discrepancy an owner and procedure; do not automatically repeat an uncertain charge.
Deliverable: reconciliation queue and decisions.
- 06
Test complete recovery
In the provider’s test mode, replay timeout, duplicate, delayed event, reversed order and missing return. Check one business transition, correct customer information and support visibility. Idempotency details differ between providers.
Deliverable: non-duplication evidence and deployment criteria.
Proposed acceptance scenarios
Fictional scenarios to adapt in an authorised environment. They describe no client result or certification.
| Fictional situation | Suggested check | Evidence to retain |
|---|---|---|
| The client times out after a request whose outcome is uncertain. | Retrieve the existing operation and state from the intended source before retrying. Separate idempotency key, order reference and business state. | Timeline and nonsensitive technical identifiers, observed state and retry policy for the relevant API. |
| A valid notification arrives twice or after a newer notification. | Test signature verification, then deduplication and business ordering. Repeated delivery should not trigger a second fulfilment or customer confirmation. | Notification identifier, accepted or ignored transition and evidence of one business effect. |
Worked example
Illustrative situation
Illustrative situation: payment succeeds, but the customer loses connection before confirmation and two notifications arrive later.
Decision and expected evidence
One order is confirmed. Recovery displays verified state, and support can reconcile the reference without requesting bank details.
Distinguish the mechanisms
| Mechanism | Purpose | Check or limitation |
|---|---|---|
| Browser return | Inform and resume the interface | Can be missing or interrupted |
| Verified webhook | Receive a provider state change | Can be repeated, delayed or out of order |
| Server reconciliation | Compare payment and order state | Needs a discrepancy-resolution rule |
Management indicators
| Indicator | What it measures | First action |
|---|---|---|
| Uncertain states | Operations unresolved within the intended delay | Check the reference state |
| Duplicate effects | Orders or processing performed twice | Fix business deduplication |
| Closed gaps | Reconciled cases with decision and evidence | Handle oldest and critical cases |
Common pitfalls
- Confirming from a success URL alone
- Treating timeout as payment failure
- Assuming events arrive in order
- Repeating a charge before checking
Frequently asked questions
Does a timeout mean failure?
No. It means the response was not received within the delay. Check the operation’s state before creating another.
Is provider idempotency sufficient?
No. Order creation, fulfilment and notifications must also tolerate repeated processing without duplicated business effects.
What should the user be told?
Explain that verification is ongoing, provide a safe reference and a way to retrieve status. Avoid requesting another payment while the previous one is uncertain.
What evidence makes a verification useful?
Keep nonsensitive technical identifiers, successive states and evidence of one business effect. Tie retries to the relevant API contract; a timeout or isolated notification may not describe final order state.
Webhooks: signatures and replay
A payment notification does not close reconciliation by itself
Authenticate each webhook, bind it to the right account and compare its effect with authorised server state. A repeated event must not repeat an initial activation; missing events must remain detectable.
- Separate notification identity from the operation to perform.
- Test overlapping manual resend and automatic retry.
- Retain uncertainty after an unknown external result and check the source before retrying.
See webhook signatures, digests and the ten cases →
Sources reviewed on · Stripe · Webhooks · Stripe · Manage webhook endpoints · GitHub · Validating webhook deliveries · GitHub · Best practices for using webhooks · GitHub · Handling failed webhook deliveries
API amount precision and exact units
Separate exact conversion from payment confirmation
An interface can display the correct price while preparing an incorrect provider integer. Acceptance must reconcile the server amount with the operation contract, then check confirmed state without mistaking arithmetic for completed payment.
- Test zero-, two- and three-decimal currencies.
- Include a case where step cannot be inferred from decimals.
- Retain an exact reference before localised formatting.
Check a unit in the workshop →
Adyen · Currency codes and minor units · Provider documentation · reviewed 2026-11-06
Stripe · Supported currencies and special cases · Provider documentation · reviewed 2026-11-06
Official references
References consulted: . The method and worksheet propose checks to adapt to your context; they do not constitute certification.
- Stripe — Payment status updates
- Stripe — Webhooks
- Stripe — Idempotent requests
- Stripe · Manage webhook endpoints
- GitHub · Validating webhook deliveries
- GitHub · Best practices for using webhooks
- GitHub · Handling failed webhook deliveries
- Adyen · Currency codes and minor units
- Stripe · Supported currencies and special cases
