Payment webhook acceptance exercise
Fone, 28 October 2026

Extract this directory and run python3 -m unittest -v.
No third-party dependencies, network access, wallets or credentials are used.
The secret is a public synthetic fixture. Never reuse it in an integration.

The teaching model uses deliberately simplified field names and selected checks.
It is not a protocol-compatible StableIn receiver. It omits the full schema,
merchant authentication, finality validation, raw request capture, durable event
storage, transaction isolation, leases and external delivery. A signed finality
field would not independently establish chain finality.

Tests demonstrate which layer makes a decision. They do not establish production
security, concurrency safety or a completed real payment. Test results appear in
test-results.txt. Worksheet checks for your environment remain Not run.

Acceptance worksheet
Case | Expected | Your result | Evidence
Changed signed bytes | Reject | Not run |
Correctly signed wrong local amount | Reject binding | Not run |
Valid signature with invalid event schema | Reject schema | Not run |
Valid paid event, current full refund | No new entitlement | Not run |
Current-order API unavailable | Defined retry path; no speculative delivery | Not run |
Same event delivered twice | Durable dedupe and one entitlement | Not run |
Different events for one purchase | One entitlement for that fulfillment unit | Not run |

This exercise is original educational material from Fone. You may copy and adapt
it with this attribution and the teaching-only scope notice retained. It comes
without a production-use or security warranty.
