A payer who leaves the hosted checkout and never returns leaves the payment pending forever, and any hold a consumer placed for it (a locked booking order) with it. Give payments a deadline and reap them.
A new terminal state STATE_EXPIRED and event PaymentEvents::EXPIRED, distinct from a decline (FAILED) and a deliberate withdrawal (CANCELLED): nobody acted, the window simply closed.
create() gains a ttl in seconds; it stamps an expires timestamp, defaulting to the configured default_payment_ttl. A non-positive ttl opts out of expiry.
expire() and expireDue() on the manager are row-locked like the other transitions, so a real outcome arriving at the deadline still wins; a cron hook runs the sweep, and a state and expires index covers it.
Covered by a kernel test: the deadline stamping, the sweep, and the cron hook.
Issue fork kessai-3611872
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedOpened merge request !15 against 1.x, kernel-tested. This is the unblocker for the orchestra (#3611873) and yoyaku (#3611874) sides, whose CI turns green once this lands in 1.x-dev.
Comment #5
mably commented