EN
E-Commerce

Payment Webhooks Arrive Late or Twice: Specify the Order Recovery Outcome

Payment Webhooks Arrive Late or Twice: Specify the Order Recovery Outcome

Time to read: 4 minutes

Content

  1. Define the transition before testing delivery
  2. Worked acceptance spec: the same late capture, two different order outcomes
  3. Accept the saved result, not the webhook response
Bookmark

A delayed capture notification can confirm an eligible order, but it must not reopen a canceled one on its own. For a payment integration handoff, specify two things separately: what the provider has verified about the payment and what the merchant still allows for the order. A redelivery can help finish incomplete work, but must not repeat a committed effect. An older notification must not undo a newer verified result.

Define the transition before testing delivery

Start with one checkout where the store saves a pending order and releases it to fulfillment only after a matching full capture. That is the policy for the example below, not a requirement for every checkout. In your spec, name the capture evidence for the specific provider, account, API version and payment method. Bind it to the accepted checkout revision and the saved order. Define the deadline for checking an unresolved order separately from any merchant deadline or decision that closes it.

Keep these three records distinct:

Worked acceptance spec: the same late capture, two different order outcomes

Fictional sandbox expectations, not executed results. Pending order O-720 is linked to P-720 for USD 64.00. The provider records a full capture at 11:01 UTC. In the first two runs, the application’s first recovery check is at 11:03; the capture notification is delivered at 11:04 and redelivered at 11:05. The recovery check and webhook apply the same order rules. The only difference between these two runs is whether the merchant accepted a cancellation before the check. The times are fixture values, not provider retry rules.

RunTrigger and starting stateRequired order outcome and evidence
Late capture, order still open11:03: provider confirms the USD 64.00 capture; the order is still eligibleO-720 becomes confirmed. Record one accepted fulfillment release against O-720 when that step completes. Both later deliveries leave the order and release count unchanged.
Late capture, cancellation already accepted11:02: merchant closes O-720; 11:03: provider confirms the same captureO-720 stays canceled. Zero releases; one financial exception linked to the capture, assigned to the payments owner for authorized disposition. Neither delivery reopens the order or creates a second exception.
Webhook-first controlDefer the scheduled check until after 11:07; don’t run manual recovery. Deliver the delayed capture notification at 11:04 while O-720 is still pending and eligible.The notification triggers confirmation of O-720 and one accepted fulfillment release by 11:05. Redeliver at 11:06, after verifying the first release. At 11:07, verify the same release ID, one order and no extra release.
Older failure arrives after confirmationFirst run has confirmed O-720; a prior unsuccessful attempt notification for the same payment object arrives afterward; the provider still verifies the captureKeep the failed attempt as history, not the current order state. O-720 stays confirmed and the release count remains one.
No notification and provider lookup unavailableSuppress delivery for the full run. At 11:03 the lookup fails; at the scheduled follow-up it verifies capture and the order is still eligible.Pending and zero releases at the first check. At follow-up, confirm O-720 and verify one accepted release. The flow recovers without a webhook.
One late capture, two order outcomes Separate test runs compare the allowed effect of the same verified capture on an eligible versus canceled order. FICTIONAL SANDBOX SPEC The same late capture Capture verified 11:03 · P-720 · $64 captured A · Order still open Confirm O-720.Release to fulfillment once. B · Order canceled Keep O-720 closed.One payment exception;no fulfillment release. Later deliveries Neither outcome changes.
The same late capture can pay an eligible order or require financial follow-up on a canceled one. The order state—not the arrival time—decides.

Counterexample: A refund that the provider now confirms before release is not a stale failure notice. For this fixture, a verified full refund before release blocks fulfillment and is recorded against the original order and payment. Define the separate response for a refund after release with the fulfillment and payments owners; don’t simply rewrite order history.

Accept the saved result, not the webhook response

Have the implementer demonstrate each run from the same starting conditions in an authorized sandbox. Retain the provider state and lookup time, event and delivery references, order transition history and accepted release or exception IDs. In the webhook-first run, tie the first delivery to the committed order transition and the accepted release before any scheduled reconciliation, then compare the release ID after redelivery. Keep the no-webhook run as a separate check that reconciliation works without delivery. Confirm that recovery did not create another payment or repeat the capture. Check the destination when a release acknowledgment is uncertain; a locally queued instruction is not proof of a downstream release. Ask the payments and commerce owners to agree who reviews unresolved cases and by when. No real card or customer data belongs in the fixture.

Use the API idempotency guide for receiver-specific retry, transaction-boundary and replay design. Add the open-versus-closed decision and its evidence to your checkout release tests; the checkout redesign acceptance guide covers the wider scenario set. If the demo can only prove that the endpoint said “received,” leave this acceptance item open.

Lassen Sie Profis Ihre Herausforderung meistern

Unsere zertifizierten Spezialisten finden die optimale Lösung für Ihr Unternehmen.

Bitte einen gültigen Namen eingeben
Bitte geben Sie ein gültiges Unternehmen ein
Bitte geben Sie eine gültige Telefonnummer an
Bitte geben Sie eine gültige E-Mail-Adresse ein
Kurze Botschaft

    Ihre Nachricht wurde erfolgreich verschickt. Wir melden uns in Kürze! Success icon