Skip to content

Webhook event ordering: payment_captured dispatched before payment_approved for the same payment #369

Description

@Masumrahmanhasan

Description

Webhook events for a single payment are dispatched out of order. When a payment is processed, the payment_approved event should be dispatched before payment_captured, but in practice payment_captured can arrive first.

Example of received webhook deliveries (in arrival order):

{
    "id": 105346,
    "name": "checkout",
    "payload": {
        "id": "evt_or6egc25wvce3mhqclbbzacfqy",
        "type": "payment_captured"
    }
}
{
    "id": 105347,
    "name": "checkout",
    "payload": {
        "id": "evt_sa4ounwnd6iupct3z6p2eyjvmy",
        "type": "payment_approved"
    }
}

Here the payment_captured delivery (id 105346) was received before the payment_approved delivery (id 105347) for the same payment.

Expected behavior

payment_approved should be dispatched before payment_captured for the same payment, reflecting the actual processing sequence (approval precedes capture).

Current behavior

payment_captured can arrive before payment_approved, forcing consumers to handle the capture event before the approval event.

Steps to reproduce

  1. Process a card payment.
  2. Collect the webhook deliveries for that payment.
  3. Observe the order of payment_approved and payment_captured — the captured event can arrive first.

Additional information

  • SDK: checkout-sdk-php
  • This affects webhook consumers that rely on event order for state transitions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions