Use callCash with AI agents
Coding agents write a lot of payment code now. Payment code is where a confident wrong guess costs real money, so callCash gives agents the rules and the docs in a form they read well.
1. Add the rules to your project#
npx callcash agentsThis adds a short callCash section to your agent's instructions file, pointing at the rules that ship inside the package (node_modules/callcash/AGENTS.md).
| Flag | File | Agent |
|---|---|---|
--codex | AGENTS.md | Codex, and most agents that read AGENTS.md |
--claude | CLAUDE.md (imports the rules with @node_modules/callcash/AGENTS.md) | Claude Code |
--cursor | .cursor/rules/callcash.mdc | Cursor |
--gemini | GEMINI.md | Gemini CLI |
--all | All four |
With no flags, it updates the files your project already has, or writes AGENTS.md.
It is safe to run again. Each file gets one section between <!-- callcash:start --> and <!-- callcash:end -->; running it again refreshes only that section, and nothing outside it is touched. A .cursor/rules/callcash.mdc you wrote yourself is left alone.
2. What the rules say#
The short version, so you know what your agent is being told:
- Amounts are rand, not cents.
- Never mark an order paid on the redirect. Only in the webhook handler, on
payment.paid. - The handler must be safe to run twice. Key it on
event.id. - Always return
r.responsefrom the webhook route, and let handler errors throw. - Real gateways need a store. Start with the test gateway.
- Yoco gives a link; Netcash gives a form the browser must post.
- Server only. Never log keys or put them in client code.
- Do not invent
cc_keys or hosted API calls: the hosted API is planned, not built.
3. Docs your agent can read#
Every page of these docs is also plain Markdown:
- /llms.txt: the index, in the llms.txt format. Give your agent this link first.
- /llms-full.txt: every page in one file.
- /docs/<page>.md: any single page, for example /docs/webhooks.md.
Each page here has a Copy page as Markdown button too.
A prompt to paste#
Add payments to this app with the callcash package.
Read node_modules/callcash/AGENTS.md and https://callcash.riverrr.co.za/llms.txt first.
Start with the built-in test gateway (new CallCash() with no config) and write tests that use
cash.test.pay and cash.test.fail. Fulfil orders only in the webhook handler on payment.paid,
make the handler idempotent by event.id, and return r.response from the webhook routes.
Keep all callcash code on the server and read keys from environment variables.MCP#
There is no callCash MCP server yet. The Markdown docs and the rules file cover what an agent needs today.