Laravel Stripe webhooks credited 5x. An inbox table fixed it

A naive Laravel handler credited 100 ledger rows for 20 paid invoices after 5 deliveries each, because Stripe delivers webhooks at least once and Cashier 16.9.0 stores no event ids.

A check-then-insert handler still wrote 26 to 28 rows under a concurrent burst; an inbox table with a unique event id, written in the same transaction as the work, wrote exactly 20 in every run.

Stock Cashier let a stale active event overwrite a canceled subscription; storing the last applied event's created time and skipping older events fixed it, at about 0.5 ms per webhook.

Read the full post

Read the full post