How arif98741/nagadapi works
Main Components
a) Core Components:
• Payment Processing Layer
• Exception Handling Layer
• Helper Utilities
• Configuration Management
• Request Handler
b) External Systems:
• Nagad Payment Gateway (Sandbox/Production)
• Merchant Application
• Client Browser/Application
┌─ Merchant Application ─────────────────┐
• Client Browser/Application │
• ┬───────────────────────┘
• ↓
┌─ Xenon/NagadApi Library ──────────────┐
• ┌─────────────┐ ┌──────────────┐ │
• Base │←→ │ Helper │ │
• ┘ └──────────────┘ │
• ↓ ↓ │
• ┌─────────────┐ ┌──────────────┐ │
• Request │ │ Exception │ │
• Handler │ │ Handler │ │
• ┘ └──────────────┘ │
• ↓ │
• ┬──────────────────────────────┘
• ↓
┌─ Nagad Payment Gateway ───────────────┐
• Sandbox / Production Environment │
• ┘
Component Descriptions
a) Base Component:
• Primary entry point for payment processing
• Handles configuration management
• Initiates payment flows
b) Helper Component:
• Utility functions
• Invoice generation
• Response parsing
• Payment verification
c) Request Handler:
• Manages HTTP communications
• Handles API endpoints
• Processes payment requests
d) Exception Handler:
• Custom exception management
• Error reporting
• Payment-specific exceptions
Payment Initiation Flow
Merchant App → Base → RequestHandler → Nagad Gateway
Payment Verification Flow
Merchant App → Helper → RequestHandler → Nagad Gateway
Callback Processing Flow
Nagad Gateway → Merchant Callback URL → Helper
Additional Elements
• Configuration nodes showing environment options (development/production)
• Security elements (merchant keys, encryption)
• Callback URL handling
• Sandbox vs. production pathways
Notes
• Separation between the library and external systems
• Clear boundaries between merchant implementation and library code
• Where configuration is required
• Security-critical paths