Refund reference application¶
The refund application models a PSP call where the network can fail after the provider accepts the refund. It proves that the application verifies the provider state instead of sending a second refund blindly.
Read these files in order:
domain.py— typed command, snapshot, preview, and result.fake_psp.py— target idempotency and authoritative query behavior.app.py— action ports and runtime wiring.test_example.py— executable normal and adversarial cases.
The tests cover stable per-intent PSP idempotency, atomic live-balance reservation, material drift, timeout after acceptance, provisional versus final absence, exact returned-effect binding, and authoritative completion.