Implement bKash payment gateway integration for Bangladesh mobile wallet payments #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds bKash Tokenized Checkout API integration, enabling mobile wallet payments for Bangladesh customers (70% market share, 60M+ users). Implements OAuth 2.0 authentication, payment lifecycle (create/execute/query/refund), multi-tenant authorization, and comprehensive error handling.
Changes
Database Schema
BKASHtoPaymentGatewayenumMOBILE_BANKINGpayment methodService Layer (
src/lib/services/bkash.service.ts)getBkashService()factoryAPI Routes
POST /api/payments/bkash/create- Multi-tenant validated payment creationGET /api/payments/bkash/callback- Status callback handler (success/failure/cancel)Membership(organization.store) +StoreStaff(direct assignment)UI Component (
src/components/bkash-payment-button.tsx)Example Usage
Configuration
Documentation
docs/BKASH_INTEGRATION_GUIDE.md- Architecture, security, testing, merchant onboardingdocs/BKASH_API_REFERENCE.md- API endpoints, service methods, error codesdocs/BKASH_IMPLEMENTATION_SUMMARY.md- Technical specs, validation resultsSecurity
Order.adminNotefor reconciliationDependencies
axios@^1.7.9- HTTP client for bKash API requestsOriginal prompt
This section details on the original issue you should resolve
<issue_title>[Phase 1.5] bKash Payment Gateway Integration</issue_title>
<issue_description>## Priority: P1
Phase: 1.5
Parent Epic: #28 (Bangladesh Payment Methods)
Estimate: 3 days
Type: Story
Overview
Integrate bKash payment gateway to enable mobile wallet payments for Bangladesh customers. bKash is Bangladesh's largest mobile financial service with 60+ million active users, accounting for 70% of mobile wallet transactions. This integration provides OAuth 2.0 authentication, tokenized payments, and comprehensive refund/reversal workflows.
Context
bKash dominates Bangladesh's mobile payment landscape:
Acceptance Criteria
OAuth 2.0 Integration
Payment Workflow (7 Steps)
Order Integration
Error Handling
Refund Processing
Security & Compliance
Testing Infrastructure
User Experience
Multi-Currency Support
Merchant Dashboard
Technical Implementation
1. bKash Service Class