Forward-Only Transition
A forward-only transition allows a record to move from an expected earlier state to a permitted later state without returning to a previous state or moving sideways. In this course, payment transitions use a conditional database UPDATE that changes the status only when the current status is PENDING, ensuring that competing webhook requests cannot both win.
Minimal example
UPDATE payments
SET status = 'CAPTURED'
WHERE id = ?
AND status = 'PENDING';