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
- Process a card payment.
- Collect the webhook deliveries for that payment.
- 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.
Description
Webhook events for a single payment are dispatched out of order. When a payment is processed, the
payment_approvedevent should be dispatched beforepayment_captured, but in practicepayment_capturedcan 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_captureddelivery (id105346) was received before thepayment_approveddelivery (id105347) for the same payment.Expected behavior
payment_approvedshould be dispatched beforepayment_capturedfor the same payment, reflecting the actual processing sequence (approval precedes capture).Current behavior
payment_capturedcan arrive beforepayment_approved, forcing consumers to handle the capture event before the approval event.Steps to reproduce
payment_approvedandpayment_captured— the captured event can arrive first.Additional information