Demo

CardForge integration

Run CardForge as a separate merchant template that consumes ZamaPay configuration.

Standalone boundary

CardForge is not part of the ZamaPay platform app. It is a standalone merchant template under `demo/cardforge` and receives only project configuration.

The browser talks to CardForge. CardForge talks to ZamaPay with its project API key. Browser cookies from ZamaPay must not be forwarded.

VariableRequiredMeaning
ZAMAPAY_PROJECT_IDyesProject id from the merchant console.
ZAMAPAY_API_KEYyesOne-time revealed project API key.
ZAMAPAY_WEBHOOK_SECRETyesSecret used to verify ZamaPay webhook signatures.
ZAMAPAY_API_URLyesRust API base URL, for example http://127.0.0.1:8080.
ZAMAPAY_CHAIN_INVOICE_API_URLyesZamaPay web URL used by the backend to create local-dev private chain invoices.
CARDFORGE_DATABASE_URLyesIndependent CardForge Postgres database URL.
CARDFORGE_STORE_KEYoptionalLocal namespace inside the CardForge database; defaults to local-dev.
CARDFORGE_WEBHOOK_ENDPOINToptionalDefaults to http://127.0.0.1:8092/api/zamapay/webhook.
NEXT_PUBLIC_CARDFORGE_API_URLfrontend onlyBrowser-safe CardForge backend URL.
NEXT_PUBLIC_ZAMAPAY_CONSOLE_URLfrontend onlyBrowser-safe link back to the ZamaPay merchant console.
CardForge boundary
Standalone demo template consumes ZamaPay configuration.
No ZamaPay cookie forwarding
FrontendCardForge storefront
BackendPOST /api/orders/checkout
ZamaPay API/api/projects/{id}/checkout-sessions
Webhook/api/zamapay/webhook

CardForge env files

CardForge has two process boundaries. The backend receives secrets from `env/local-dev.cardforge-backend.env`; the frontend receives only browser-safe `NEXT_PUBLIC_*` values from `env/local-dev.cardforge-frontend.env`.

set -a
. env/local-dev.cardforge-backend.env
. env/supabase.cardforge-backend.env # optional database override
set +a
cargo run --manifest-path demo/cardforge/backend/Cargo.toml

set -a
. env/local-dev.cardforge-frontend.env
set +a
npm --prefix demo/cardforge/frontend run dev -- --hostname 127.0.0.1 --port 3002

Closed loop proof

Use the local readiness gate for service truth, then run the browser CardForge flow for the private checkout proof. The old direct payment-projection script is intentionally removed.

npm run verify:local

Ready to wire a merchant project?

Create the project in the console, then keep external checkout creation on the project API-key path.

Open console