Quickstart
Create a payment project, issue a project API key, and hand CardForge a hosted checkout contract.
The shortest correct path
ZamaPay starts from a merchant payment project. The browser console creates the project and reveals one-time secrets; the merchant backend uses those secrets to create checkout sessions.
The buyer-facing hosted checkout URL is returned only after ZamaPay has assigned a non-null chain invoice id.
Open Docs from the public top bar, then log in and open the merchant console when you are ready to configure a real project.
Create a project with `local-dev`. Add the merchant backend webhook URL during creation when possible.
Generate a project API key and copy the one-time value into the merchant backend environment. Store the prefix for operations, not as an auth secret.
Call the project checkout endpoint from the merchant backend. The merchant frontend must never call this endpoint with a dashboard cookie.
Local stack
Use these local services for the deterministic closed loop. After every Hardhat Local reset, run the root reset command once so the ZamaPay and CardForge databases match the fresh chain.
Environment files live under `env/`: commit only `*.env.example`, keep same-name `.env` files local, and source the file for the process you are starting.
# Terminal 0: after starting Hardhat Local
npm run reset:local-dev
# Terminal 1: ZamaPay API
set -a
. env/local-dev.zamapay-api.env
set +a
cargo run -p api
# Terminal 2: ZamaPay web
set -a
. env/local-dev.zamapay-web.env
set +a
npm --workspace apps/web run dev -- --hostname 127.0.0.1 --port 3001
# Terminal 3: CardForge backend
set -a
. env/local-dev.cardforge-backend.env
set +a
cargo run --manifest-path demo/cardforge/backend/Cargo.toml
# Terminal 4: CardForge frontend
set -a
. env/local-dev.cardforge-frontend.env
set +a
npm --prefix demo/cardforge/frontend run dev -- --hostname 127.0.0.1 --port 3002Supabase overrides
Supabase changes the Postgres host, not the local-dev chain. Source the local-dev file first and the Supabase override second so only the database URL is replaced.
# ZamaPay API with Supabase Postgres
set -a
. env/local-dev.zamapay-api.env
. env/supabase.zamapay-api.env
set +a
cargo run -p api
# CardForge backend with Supabase Postgres
set -a
. env/local-dev.cardforge-backend.env
. env/supabase.cardforge-backend.env
set +a
cargo run --manifest-path demo/cardforge/backend/Cargo.tomlReady to wire a merchant project?
Create the project in the console, then keep external checkout creation on the project API-key path.
