Skip to content

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

ModulePackagePurposeProvider
MQ-Pay@nx/mq-payMulti-provider payment processingVNPAY (+ internal cash/bank)
IIAPI@nx/iiapiElectronic invoice issuance (viiAPI)VNPAY
T-VAN@nx/t-vanTax-authority lookup & invoice queryVNPAY → CQT
MQ-SMS@nx/mq-smsTransactional SMS gatewayVNPAY

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:

IntegrationPrefixExample
MQ-PayAPP_ENV_MQ_PAY_*APP_ENV_MQ_PAY_POSTGRES_HOST
IIAPIAPP_ENV_IIAPI_*APP_ENV_IIAPI_API_KEY
T-VANAPP_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' });

Next steps

  • MQ-Pay - payment processing (VNPAY QR / Phone POS / Smart POS, internal cash/bank)
  • IIAPI - electronic invoice issuance
  • T-VAN - tax-authority lookup & invoice query
  • MQ-SMS - transactional SMS

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.