A webhook handler checklist for Stripe subscriptions: six things that break quietlyBody

Wait 5 sec.

Most subscription bugs aren't in the checkout. They're in the handler that decides what a payment means. Six things to check: Verify the signature on every event and reject anything that fails. Return a 2xx quickly and do the heavy work afterward, so slow processing doesn't trigger retries. Store the event ID and skip repeats. The same event can be sent more than once. Don't rely on arrival order. Events can come out of sequence, so fetch the current subscription from the API before you change someone's access. Expect a pile of old events after downtime. Failed deliveries are retried for days, so your handler has to cope with a burst arriving at once. Keep a log of event IDs and what you did with each. When a customer says they paid, you can answer in a minute instead of an afternoon. If your handler does something different, I'd like to hear what and why.   submitted by   /u/Apurv_Bansal   to   r/stripe [link]   [comments]