The example workflow locked the order with an n_lock action when the flow entered the payment step, and unlocked it with n_unlock on Back. That locks the order too early, on the payment landing page before the payer commits to paying, and makes the lock a workflow concern rather than a payment one.

Drive it from the payment round-trip instead. A new OrderLockSubscriber in yoyaku_payment locks the order on kessai.initiated (the payer deliberate handoff to the provider) and unlocks it back to the editable basket on a failed or cancelled payment. It runs whether or not the event is handled, since the order lock is orthogonal to who resumes the workflow, and acts only on the checkout payment whose subject is the order.

The example workflow drops n_lock and n_unlock: the payment-required route goes straight to the payment step, its Back goes straight to the form, and n_place still places the order on both the paid and free branches. The LockOrder and UnlockOrder action plugins stay, so a custom workflow can still use them.

Depends on the kessai handoff event (kessai #3611852); orchestra side is #3611855. Covered by the end to end workflow test.

Issue fork yoyaku-3611856

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 !47 against 1.x. OrderLockSubscriber locks the order on kessai.initiated and unlocks on failure or cancellation; the example workflow drops n_lock and n_unlock (kept n_place on both branches and the action plugins). The full end to end suite passes locally (10 tests). Depends on the kessai handoff event (kessai #3611852), so CI here goes green once that has landed in kessai 1.x-dev.

  • mably committed 43bb20d1 on 1.x
    feat: #3611856 Drive the order's checkout lock from the payment round-...
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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.