Step-by-step guide to integrating Bangladeshi payment gateways into your web application.
Integrating bKash and Nagad into Bangladeshi web applications is a requirement for almost every e-commerce project we build. Here is our complete guide based on 30+ integrations.
bKash Integration
bKash offers three integration methods: Checkout, URL, and App-to-App. For web applications, we recommend the Checkout method as it provides the best user experience and security.
Step 1: Get API Credentials
Create a merchant account at developer.bka.sh and obtain your App Key, App Secret, Username, and Password for the sandbox environment.
Step 2: Token Management
bKash uses a bearer token system that expires every 3600 seconds. Implement a token refresh mechanism on your backend to avoid payment interruptions.
Nagad Integration
Nagad's API follows a similar pattern but uses RSA encryption for request signing. Store your merchant private key securely and never expose it to the client.
Common Pitfalls
1. Not handling callback URLs for payment verification
2. Missing idempotency on payment creation
3. Not testing edge cases like network timeouts during payment
Testing
Always test with small amounts (1-2 BDT) in production before going live with full transactions.
Arif Khan
Lead Developer
An expert writer at Fonix-IT specializing in digital marketing, web development, and business growth.
Need help growing your business?
Our team is ready to create a custom digital strategy for your business.
Get Free Consultation