When an order (a booking transaction) is deleted, its payment records are left behind, still pointing at a transaction that no longer exists.
Every module that hangs entities off the order cleans them up on delete through hook_yoyaku_transaction_predelete(): the engine removes the order's booking lines, and the workflow bridge removes its process instance. yoyaku_payment does not, so its BookingPayment entities (which reference the order) are orphaned.
Proposed fix
Add a yoyaku_transaction_predelete hook in yoyaku_payment that deletes the payments referencing the order, mirroring the engine's booking-line cleanup. The durable record survives in the payment audit trail, and a stored-card token is already forgotten at the gateway on cancellation (the StoredCardCleanup subscriber), so this only removes the now-orphaned operational rows.
Issue fork yoyaku-3609081
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 #3
mably commentedComment #5
mably commented