The policy
Amounts are integer minor units. Both ends of each band are bound, because an upper bound alone lets a negative amount through, and a refund of a negative amount is a charge.runnable
The code
runnable file=main.py
What the agent sees
refund:txn_1, which had already committed.
The receipt
runnable
allow/committed, approve/committed with the approver, deny/denied, and
allow/blocked for the duplicate.
When an AMBIGUOUS appears
A refund whose reply was lost isAMBIGUOUS and a retry is refused. Look up the payment in the
Stripe dashboard, then ctrlrun resolve refund:txn_N --committed or --failed. A reconcile
hook that queries stripe.Refund.list(payment_intent=...) does the same automatically:
Reconcile against the remote.
Run it
The policy and the code above are also a directory in the repository, extracted from this page and run in CI against a fake remote:Next
- A payout agent with maker/checker: the same money, two people.
- Approval binding · Get started · Why.