Who is this for?
Web developers who want to accept Naira payments using the Monieswitch
Checkout widget in their websites or web applications.
Overview
This guide covers:- Direct Checkout (simple, client-side)
- Continued Checkout (secure, server-initialized)
- Payment verification with webhooks
- Basic error handling
Prerequisites
1
Monieswitch Account
A Monieswitch account. Register at Monieswitch
Dashboard.
2
API Keys
Your public and secret keys from the Monieswitch dashboard.
3
Web Application
A website or web application where you want to accept payments.
1. Setup
Add Monieswitch Library
Include this script in your HTML:index.html
2. Direct Checkout (Simple)
Best for quick implementations and testing.index.html
3. Continued Checkout (Recommended)
More secure as payment details are initialized on your server.Backend Setup
backend/server.js
Frontend Implementation
index.html
5. Payment Verification
Backend Verification
backend/server.js
Webhook Handler (Recommended)
backend/server.js
6. Environment Variables
Create a.env
file for your backend:
Security Best Practices
- Never expose your SECRET_KEY in frontend code - Always verify payments on your backend - Use webhooks for reliable payment notifications - Validate all payment amounts server-side
- Client-side: Only use your public key
- Server-side: Keep your secret key secure
- Verification: Always verify payments on your backend
- Webhooks: Use webhooks for real-time payment updates
Common Payment Channels
The supported payment channels in Nigeria are:- BANK - Bank transfer
- CARD - Debit/Credit cards
- USSD - USSD payments
Error Handling
Next Steps
- Set up webhooks for reliable payment notifications
- Add payment status tracking in your app
- Test with small amounts before going live
- Check the API Reference for more features