Issue #3614427: A captured or refunded security deposit settles the booking, because settlement never checks the payment kind
An order carries more than its checkout payment, and DefaultSettlementSubscriber read every payment whose subject was the order as if it were that one.
The two bugs
- Capturing a charge-mode security deposit confirmed the held lines, even when the checkout payment never happened. A deposit guarantees a booking; it does not pay for one.
- Refunding a deposit cancelled the order it guaranteed. Refunding a charge-mode deposit after the event is how a deposit ends normally, so this is the worse of the two.
The fix
Capture and refund now answer for the checkout payment alone (KIND_PAYMENT) — the same scoping OrderLockSubscriber already applies to the lock (it returns early on any other kind, precisely so a deposit does not drive the checkout lock).
Failure deliberately keeps answering for either kind: a booking accepted on the strength of a guarantee has no basis once the guarantee is refused, so a refused deposit authorization still releases the lines it was taken for. Only lines still held are ever touched, so a path that no longer applies is a no-op rather than a correction. Each path states its kind in its docblock, and docs/payment.md carries the same table.
What the kind cannot reach
A no-show fee is charged through PaymentManager::chargeToken(), whose $kind defaults to KIND_PAYMENT, and ChargeNoShowAction does not override it, so the fee is indistinguishable from the checkout payment. Its capture is harmless (by then no line is held), but its refund would read as an order cancellation. Filed as [#3614433], which wants a fee kind in kessai, and recorded in the class docblock so the gap is visible where it matters.
Testing
DefaultSettlementSubscriberTest is new — this subscriber had no coverage at all. Five cases: captured checkout payment confirms, captured deposit confirms nothing, refunded deposit leaves the order alone, refunded checkout payment still cancels, refused deposit authorization still releases.
Verified by removing only the kind arguments: the two deposit tests then fail (a captured deposit confirmed the line, a refunded one cancelled the order) while the three regression tests pass either way.
22/22 kernel classes green across yoyaku_payment and yoyaku_orchestra; phpcs, cspell and phpstan clean. No translation change: the diff adds no user-facing string.