Expose fail() and cancel() on Receiver session
This gives implementers the ability to manually fail or cancel a receiver Payjoin session. A user might cancel a session for any reason, or the wallet might fail it if e.g. it detects a double-spend or cannot proceed past a transient error.
Note that the unit tests for closed sessions will need to be reworked once #1132 is merged, since the expected_receiver_state should be an error.
I used Claude sonnet 4.5 (it's quite good) to write the generic methods and unit tests.
Pull Request Checklist
Please confirm the following before requesting review:
- [x] I have disclosed my use of AI in the body of this PR.
- [x] I have read CONTRIBUTING.md and rebased my branch to produce hygienic commits.
Pull Request Test Coverage Report for Build 18177469540
Details
- 56 of 56 (100.0%) changed or added relevant lines in 2 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage increased (+0.08%) to 84.648%
| Totals | |
|---|---|
| Change from base Build 18176477486: | 0.08% |
| Covered Lines: | 8756 |
| Relevant Lines: | 10344 |
💛 - Coveralls
I wanted to pose a question as to why we really need to have these 2 seperate instead of just having application devs use fail() OR cancel() and provide a reason instead of having both of these?