Page de paiement Mobile Money intégrant l'API Ashtech Pay pour 16 pays africains.
pnpm --filter @workspace/api-server run dev— run the API server (port 8080)pnpm --filter @workspace/payment-page run dev— run the payment page frontendpnpm run typecheck— full typecheck across all packagespnpm run build— typecheck + build all packagespnpm --filter @workspace/api-spec run codegen— regenerate API hooks and Zod schemas from the OpenAPI spec
- pnpm workspaces, Node.js 24, TypeScript 5.9
- API: Express 5
- Frontend: React + Vite + TanStack Query + shadcn/ui
- Validation: Zod (
zod/v4),drizzle-zod - API codegen: Orval (from OpenAPI spec)
- Build: esbuild (CJS bundle)
lib/api-spec/openapi.yaml— API contract (source of truth)artifacts/api-server/src/routes/payment.ts— Ashtech Pay proxy routesartifacts/payment-page/src/pages/— Frontend payment pagelib/api-client-react/src/generated/— Generated React Query hooks
- The backend proxies all Ashtech Pay API calls to keep the API key server-side only
- Countries list is hardcoded as fallback (from API docs) since Cloudflare blocks server-side requests to ashtechpay.top; the live API is tried first
- The frontend detects all 4 payment flows (USSD Push, OTP SMS, OTP USSD, Wave) based on HTTP status + response fields
- Transaction status is polled every 5 seconds until a final state (success/failed) is reached
AshtechPay — A payment page for initiating Mobile Money payments across 16 African countries. Supports:
- Form: name, amount, country, operator (dynamic per country), phone number
- All 4 Ashtech Pay flows: USSD Push, OTP SMS, OTP USSD, Wave
- Real-time transaction status polling
- Success and failure states with full transaction details
Populate as you build — explicit user instructions worth remembering across sessions.
- The Ashtech Pay API site (ashtechpay.top) is protected by Cloudflare and blocks server-side requests from cloud IPs. The
/countriesendpoint falls back to hardcoded data. The/collectand/transactionendpoints still proxy to Ashtech Pay — they may work once the account's IP is whitelisted. - ASHTECH_PAY_API_KEY must be set in the environment (currently in api-server artifact.toml dev section)
- After each OpenAPI spec change, run
pnpm --filter @workspace/api-spec run codegen
- See the
pnpm-workspaceskill for workspace structure, TypeScript setup, and package details