Invoice payment portal using PesaPal (card payments).
-
Install dependencies:
npm install
-
Copy
.env.exampleto.envand fill required values:NEXT_PUBLIC_PROJECT_URL— Supabase project URLNEXT_PUBLIC_API_KEY— Supabase anon keySUPABASE_SERVICE_KEY— Supabase service role keyPESAPAL_ENV—sandboxorproductionPESAPAL_CONSUMER_KEY— PesaPal consumer keyPESAPAL_CONSUMER_SECRET— PesaPal consumer secretNEXT_PUBLIC_APP_URL— Application base URLNEXT_PUBLIC_COMMS_WORKER_URL— Comms worker URL for sending email (e.g. http://localhost:8789)WORKER_API_KEY— Shared secret sent asX-API-Keyto worker endpoints
-
Run migrations:
supabase db push
npm run devnpm run build
npm startlib/pesapal/— PesaPal API client (orders, IPN registration)lib/services/— Business logic (invoice search)app/page.tsx— Search interfaceapp/[id]/— Invoice detail and payment pageapp/api/— API routes for PesaPal and invoice lookupsapp/components/— Shared UI components