Framework Packages
Framework-specific integration packages built on top of QPay core SDKs. Each package follows the conventions of its target framework, providing dependency injection, configuration, webhook handling, UI components, and event-driven payment notifications out of the box.
Available Frameworks
| Framework | Package | Registry | Language | Base SDK |
|---|---|---|---|---|
| Laravel | qpay-sdk/laravel | Packagist | PHP | qpay-php |
| Django | django-qpay | PyPI | Python | qpay-py |
| Spring Boot | qpay-spring-boot-starter | Maven Central | Java | qpay-java |
| Express | @qpay-sdk/express | npm | TypeScript | qpay-js |
| NestJS | @qpay-sdk/nestjs | npm | TypeScript | qpay-js |
| Rails | qpay-rails | RubyGems | Ruby | qpay |
| ASP.NET Core | QPay.AspNetCore | NuGet | C# | QPay |
| Flutter | qpay_flutter | pub.dev | Dart | qpay |
| FastAPI | fastapi-qpay | PyPI | Python | qpay-py |
What Each Package Provides
All framework packages share a common set of features:
- Auto-configuration — Zero-boilerplate setup using the framework’s native configuration system
- Dependency injection — QPay client registered as a service/singleton in the framework’s DI container
- Webhook controller — Pre-built endpoint that receives QPay callbacks, verifies payments, and dispatches events
- Events/Signals — Framework-native events fired when payments are received or fail
- UI helpers — QR code rendering and bank payment link components (Blade, Thymeleaf, Django templates, ERB, Flutter widgets)
- Testing support — Mock-friendly architecture with testable service interfaces
Architecture
Each framework package is a thin wrapper around its corresponding core SDK:
Your Application
|
Framework Package (Laravel, Django, Spring Boot, etc.)
|
Core SDK (qpay-php, qpay-py, qpay-java, qpay-js, etc.)
|
QPay V2 REST APIThe framework package handles configuration, DI, routing, and events. The core SDK handles HTTP requests, authentication, token management, and serialization.
Environment Variables
All framework packages use the same set of environment variables:
| Variable | Description | Default |
|---|---|---|
QPAY_BASE_URL | QPay API base URL | https://merchant.qpay.mn |
QPAY_USERNAME | Merchant username | (required) |
QPAY_PASSWORD | Merchant password | (required) |
QPAY_INVOICE_CODE | Default invoice code | (required) |
QPAY_CALLBACK_URL | Webhook callback URL | (required) |
Choosing a Framework Package
- PHP: Laravel for Laravel apps
- Python: Django for Django, FastAPI for FastAPI
- Java: Spring Boot for Spring Boot apps
- JavaScript/TypeScript: Express for Express, NestJS for NestJS
- Ruby: Rails for Ruby on Rails apps
- C#: ASP.NET Core for .NET web apps
- Dart/Flutter: Flutter for mobile apps
If your framework is not listed, use the core SDK directly for your language.
Last updated on