Problem/Motivation
PaymentInteraction::show() decides whether a payment is already away at a hosted gateway by asking the pinned payment for getHostedCheckoutId(). Kessai replaced that with getCheckoutSession(), returning a CheckoutSession value object, so the call is now to an undefined method and the page fatals:
Error: Call to undefined method Drupal\kessai\Entity\Payment::getHostedCheckoutId() in Drupal\orchestra_payment\Plugin\Interaction\PaymentInteraction->show() (line 337)
It is reached by a payer who returns to the landing page while a payment is pending, which is the ordinary case after a back button, a reload, or an abandoned redirect. Both projects are at their current 1.x heads, so this is committed code against committed code.
Why nothing caught it
That branch had no test at all. Nothing named PaymentInteraction, nothing asserted the "being processed" message, and nothing called PinnedPayment::inState() outside unrelated unit tests. So the rename in the provider could not turn anything red here, and the suite stayed green while the page was dead. phpstan on orchestra_payment reports the call correctly, but it is allow_failure on the pipeline.
Proposed resolution
Ask getCheckoutSession() instead, which carries the same meaning: a session exists exactly when the payer was sent to a hosted checkout.
Cover the branch, since its absence is the actual defect. Two cases: a pending payment holding a session reports the payment is in flight, and a pending payment holding none still offers to pay, so the fix cannot be "always report in flight".
Remaining tasks
Review. Then check whether other consumers of the kessai payment accessors have the same untested gap.
User interface changes
None. The page renders instead of fataling.
API changes
None.
Data model changes
None.
Issue fork orchestra-3615265
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