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

Command icon 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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

Opened 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.

  • mably committed f44b9ca7 on 1.x
    feat: #3611872 Expire lapsed payments (kessai.expired and a cron reaper...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.