Appearance
Paystack Web Subscription Test
Use this checklist to validate end-to-end web subscription payment activation with Paystack test keys.
1) Backend environment
Set these in Backend/ipos_backend/.env:
env
PAYSTACK_SECRET_KEY=sk_test_xxx
PAYSTACK_PUBLIC_KEY=pk_test_xxx
PAYSTACK_WEBHOOK_SECRET=sk_test_xxx
PAYSTACK_BASE_URL=https://api.paystack.co
PAYSTACK_SUBSCRIPTION_CALLBACK_URL=https://<your-frontend-host>/subscription/renewNotes:
PAYSTACK_WEBHOOK_SECRETcan be the same asPAYSTACK_SECRET_KEYfor this integration.- Callback URL should point to your web app route that now auto-verifies
reference.
2) Start backend and frontend
Backend:
powershell
cd Backend/ipos_backend
python manage.py runserver 0.0.0.0:8000Frontend:
powershell
cd Frontend/pos-frontend
npm run dev3) Start ngrok for webhook delivery
powershell
ngrok http 8000Copy the HTTPS forwarding URL, for example:
https://abcd-1234.ngrok-free.app
Your webhook URL becomes:
https://abcd-1234.ngrok-free.app/api/paystack/webhook/
4) Configure Paystack test dashboard
In Paystack Dashboard test mode:
- Set webhook URL to your ngrok webhook URL.
- Keep your test secret and public keys in your backend and frontend env.
5) Run payment flow from web app
- Login as business admin.
- Open subscription page.
- Choose plan and duration.
- Click
Continue to Paystack. - Complete payment in Paystack test checkout.
- Confirm redirect back to
/subscription/renew?reference=....
Expected result:
- Frontend auto-calls verify endpoint.
- Business subscription activates automatically.
6) Verify backend records
Check admin:
PaystackSubscriptionPaymentstatus should becomesuccess.subscription_applied_atshould be set.- Business
subscription_planandsubscription_endshould be updated.
7) Quick API checks
Initialize:
http
POST /api/paystack/subscriptions/initialize/Verify:
http
GET /api/paystack/subscriptions/verify/{reference}/Webhook:
http
POST /api/paystack/webhook/Troubleshooting
Invalid Paystack signature: verify webhook URL and secret key.Amount or currency mismatch: ensure plan pricing currency and amount matches checkout.Failed to initialize Paystack checkout: verifyPAYSTACK_SECRET_KEYtest key and network access.