Dori Media

Engineering note

Webhook-driven state machines

Reliable payments require explicit state transitions, not ad-hoc flags.

Webhooks Payments Laravel Stripe Queues
About 4 min read Published 1 November 2025

Founder, Dori Media · Christchurch · Laravel & Stripe since 2011

On this page

The idea

Every event is a state transition. Make it explicit, logged, and replayable.

The approach

  • Normalize incoming events
  • Map to a single state machine
  • Make transitions idempotent
  • Keep an audit log for every change

Outcome

Fewer double-charges and clearer incident responses.

This note sits under Web apps & platforms. See also all journal writing.

Building something similar?

Want to talk it through?

Booking systems, internal tools, multi-tenant platforms. I build and run them from Christchurch, and I will tell you honestly if you should stay on what you have got.