#Webhooks

2 items tagged “Webhooks

TILPayments4 min read

Making Stripe Webhook Handlers Idempotent After a Duplicate Purchase Grant

TIL that Stripe can and will deliver the same webhook event more than once, and a handler that reacts to checkout.session.completed by granting access will happily grant it twice — the fix was recording processed event IDs and treating the handler as a set operation, not an append.

#Stripe
TILArchitecture2 min read

Webhooks retry, so make the receiver idempotent — not the sender reliable

TIL that webhook delivery is at-least-once, not exactly-once. Instead of trying to prevent duplicate deliveries, derive a deterministic ID from the event and let the receiver refuse to redo work it already did.

#Webhooks