Third-Party Integrations
BANA integrates with external services through modular IGNIS components. Each integration is a self-contained component that mounts into a service application. All four are currently implemented against VNPAY as the sole provider.
Available Integrations
| Module | Package | Purpose | Provider |
|---|---|---|---|
| MQ-Pay | @nx/mq-pay | Multi-provider payment processing | VNPAY (+ internal cash/bank) |
| IIAPI | @nx/iiapi | Electronic invoice issuance (viiAPI) | VNPAY |
| T-VAN | @nx/t-van | Tax-authority lookup & invoice query | VNPAY → CQT |
| MQ-SMS | @nx/mq-sms | Transactional SMS gateway | VNPAY |
These packages live under
third-parties/and are consumed as libraries (mounted via a component), not deployed as standalone services.
Integration architecture
Every integration follows the same IGNIS component shape:
Common configuration pattern
Bind options in preConfigure(), then load the component (mq-pay shown):
typescript
import { MQPayComponent, BindingKeys, IOptions } from '@nx/mq-pay';
class MyApplication extends BaseApplication {
preConfigure() {
this.bind<IOptions>({ key: BindingKeys.OPTIONS }).toValue({
enableControllers: true, // auto-register REST endpoints
clients: [{ name: 'default', provider: 'VNPAY_QR_MMS' /* provider config */ }],
});
this.component(MQPayComponent);
}
}Environment variables
Each integration uses a dedicated prefix:
| Integration | Prefix | Example |
|---|---|---|
| MQ-Pay | APP_ENV_MQ_PAY_* | APP_ENV_MQ_PAY_POSTGRES_HOST |
| IIAPI | APP_ENV_IIAPI_* | APP_ENV_IIAPI_API_KEY |
| T-VAN | APP_ENV_TVAN_* | APP_ENV_TVAN_TAX_CODE |
Accessing integration services
Via dependency injection
typescript
import { inject } from '@venizia/ignis';
import { PaymentService } from '@nx/mq-pay';
export class SaleOrderService {
constructor(
@inject({ key: 'services.PaymentService' })
private paymentService: PaymentService,
) {}
async checkout(orderId: string) {
return this.paymentService.makePayment({
source: { type: 'SaleOrder', id: orderId },
payment: { provider: 'VNPAY_QR_MMS', total: 100000 },
});
}
}Via AppRegistry (Redis, providers)
typescript
import { AppRegistry } from '@nx/mq-pay';
const registry = AppRegistry.getInstance();
const redis = registry.getRedis({ name: 'redis:@nx/mq-pay/redis-queue' });
const provider = registry.getPaymentProvider({ name: 'VNPAY_QR_MMS' });