@laranex/nestjs-myanmar-payments
v4.0.0-dev.18
Published
NestJS integration for Myanmar payment gateways: KBZ Pay, Wave Pay, Wave Pay Mini App, AYA Pay, Yoma MMQR and CyberSource. Built on Node Myanmar Payments. Injectable module, verified callbacks and test fakes.
Downloads
2,348
Maintainers
Readme
NestJS Myanmar Payments
NestJS integration for Myanmar payment gateways: KBZ Pay, Wave Pay, Wave Pay Mini App, AYA Pay, Yoma MMQR and CyberSource. Built on Node Myanmar Payments. Injectable module, verified callbacks and test fakes. Built for humans and AI agents.
Every Myanmar payment gateway signs, sends and acknowledges payments its own way, with its own rules for amounts. NestJS Myanmar Payments puts KBZ Pay, Wave Pay, Wave Pay Mini App, AYA Pay, Yoma MMQR and CyberSource behind one injectable service. All gateway logic lives in Node Myanmar Payments; this package wires it into NestJS.
Why NestJS Myanmar Payments
- One module, every gateway.
MyanmarPaymentsModule.forRoot()orforRootAsync()providesMyanmarPaymentsServicewithkbzPay(),wavePay(),wavePayMiniApp(),ayaPay(),yomaMmqr()andcyberSource(), configured from environment variables or module options. - A typed result for each flow. Every payment returns a
RedirectPayment,FormPayment,QrPayment,AppPaymentorMiniAppPayment, so you always know what to do next. See Payment Flows. - Exact amounts. Whole numbers or
Amountvalues, never floats, checked against each gateway's documented rules before any request is sent. - Verified callbacks.
@VerifiedCallback()checks the gateway's signature against the exact body it sent and injects aPaymentCallbackwhose status is onePaymentStatus;@AcknowledgeCallback()sends the response the gateway expects. - NestJS all the way down. Injectable gateways (
@InjectKbzPay()and the rest), Express or Fastify,@nestjs/configfor settings,@nestjs/cache-managerfor shared Yoma MMQR and Wave Pay Mini App tokens, and AYA Pay and CyberSource checkout forms that open from an encrypted link. - Easy to test. A fake
fetchsees every gateway call,MyanmarPaymentsServicecan be overridden, and signed callbacks can be posted to your own routes. See Testing. - Your webhooks, your storage. The package never stores webhooks; the docs show the recommended store, acknowledge and process-once flow as sample code. See Handling Webhooks.
- Ready for AI agents. An agent skill, installed with
npx skills add, teaches coding agents to use the package correctly.
Installation
Requires Node.js 20+ and NestJS 10 to 12, on the Express (
@nestjs/platform-express) or Fastify (@nestjs/platform-fastify) adapter.
npm install @laranex/nestjs-myanmar-payments@nextUntil v4.0.0 is released the package ships 4.0.0-dev.* pre-releases, so install the next tag.
Documentation
The full documentation lives at laranex.vercel.app/nestjs-myanmar-payments:
- Introduction: what NestJS Myanmar Payments does and why to use it
- Installation: registering the module, keeping the raw body and what the package exports
- AI Agent Skill: installing the agent skill with
npx skills add - Configuration: environment variables, production and UAT endpoints, the HTTP client, the auto-submit form route and the cache
- Amounts: exact amounts and each gateway's rules for decimals and minimums
- Payment Flows: redirect, form, QR and app payments and the typed result each returns
- Callbacks & Status: verifying callbacks,
PaymentStatus, acknowledging and status checks - Handling Webhooks: the recommended verify, store, acknowledge and process-once flow
- Testing: a fake
fetch, signed callbacks with supertest, overriding the service and following form links - KBZ Pay: PWA redirect, QR and in-app payments, status checks and callbacks
- Wave Pay: redirect payments with line items and callbacks
- Wave Pay Mini App: access tokens, signed mini app payments and callbacks verified against the request URL
- AYA Pay: the AYA Payment Gateway hosted checkout, channel discovery, status checks and callbacks
- Yoma MMQR: QR images, QR renewal, status checks and callbacks
- CyberSource: Secure Acceptance card payments with a signed hosted checkout form
- Results: every field of
RedirectPayment,FormPayment,QrPaymentandAppPayment - PaymentCallback & Status: every field of
PaymentCallback,PaymentStatusResultandPaymentStatus - Errors: validation, API, signature and configuration errors
License
MIT. See LICENSE.md.
