kessai #3614954: cancel() can only void a whole hold, so a guarantee cannot be partly claimed and partly released gives a payment four amounts instead of one, so a hold can be claimed in part, more than once, and released in part. Two things in orchestra_payment follow from that, neither of them a defect here: the provider changed under us.
The kernel fixtures. All eight kernel classes install kessai_payment alone. cancel() now writes a kessai_reversal row, so SettleTaskTest::testZeroCaptureAmountReleasesAuthorization, which releases an authorization whose capture amount is zero, needs that entity's schema installed. The classes that never move money need nothing.
One assertion describes the old model. SettleTaskTest::testCapturesResolvedAmountNotAuthorized asserts that after capturing 20,00 of a 50,00 authorization the payment's amount reads 20,00, because kessai used to overwrite it with what was claimed. It no longer does: the amount stays 50,00 and getCapturedAmount() is 20,00, which is the point of the change, so the assertion moves to the accessor that now carries that fact. The test's own subject, that the step captures the resolved amount rather than the authorized one, is unchanged and still worth pinning.
No production code changes. SettleTask calls capture($payment, $captureAmount), and $final defaults to TRUE, so it still closes the authorization and releases anything unclaimed exactly as before. Its zero-capture path calls cancel($payment) with no amount, which still releases the whole hold. PaymentInteraction uses cancelPending(), which is untouched.
Worth considering separately, and deliberately not here: whether a Payable should be able to say that its capture is not the last one, so a workflow could claim part of a guarantee and keep the rest live. That is a feature for the resolver contract, not a fix.
Ordering: this cannot go green until #3614954: cancel() can only void a whole hold, so a guarantee cannot be partly claimed and partly released reaches drupal/kessai 1.x-dev, since require-dev resolves the packaged dev release. Same shape as yoyaku #3614435: A charge-mode security deposit cannot be returned without refunding the whole booking waiting on #3614923: refund() can only return a payment whole, and a refund leaves no record of its own.
Issue fork orchestra-3614960
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 #4
mably commented