Engineering handbook

How Chebit is built, practice by practice.

Each practice of a professional payment system: the rule, the failure that it prevents, the module and function that implement it, the test that proves it, and the gaps that remain.

The practices

Where each rule lives in the code.

Open a practice to read it. The same text is in docs/HANDBOOK.md, and an agent reads it through the MCP server.

Review

What a review found.

For agents

Connect an agent.

An MCP server gives an AI agent the public payment API and this handbook. It is one Elixir script with no dependency.

  • create_payment_intent
  • confirm_payment_intent
  • get_payment_intent
  • list_balances
  • handbook_list
  • handbook_read
  • Integers only

    An amount is a JSON integer in the smallest unit of its currency. A float is refused.

  • One effect

    Each write sends an idempotency key. The tool returns the key, and a retry with that key makes no second effect.

  • Unknown is not failed

    After a timeout the answer says that the outcome is unknown, and it names the key to send again.

  • The same door

    The agent uses the public API with the merchant's key. The server never prints the key.

It runs on your machine: mcp/chebit_mcp.exs. The remote server is a later phase.