npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dungxa27/tori-acb

v0.3.1

Published

ToriACB payment package

Readme

Tori ACB Integration

NestJS module for ACB (Asia Commercial Bank) integration - Login, Balance, and Transaction History.

Installation

npm install @tori/tori-acb

Usage

Import Module

import { Module } from '@nestjs/common';
import { ACBModule } from '@tori/tori-acb';

@Module({
  imports: [
    ACBModule.forRoot({
      router: 'acb', // Custom router path (default: 'acb')
      timeout: 30000,
      retryAttempts: 3,
    }),
  ],
})
export class AppModule {}

Async Configuration (with MongoDB Settings)

import { MongoService } from './mongo.service';

@Module({
  imports: [
    ACBModule.forRootAsync({
      useFactory: async (mongoService: MongoService) => {
        const settings = await mongoService.getSettings();
        
        return {
          router: settings.acbRouter || 'acb', // Dynamic router from DB
          timeout: 30000,
        };
      },
      inject: [MongoService],
    }),
  ],
})
export class AppModule {}

MongoDB Schemas

Package này cung cấp schemas để dự án khác tự connect MongoDB:

ACBSession Schema

import { ACBSessionSchema } from '@tori/tori-acb';
import { MongooseModule } from '@nestjs/mongoose';

MongooseModule.forFeature([
  { name: 'ACBSession', schema: ACBSessionSchema }
])

Fields:

  • sessionId - Unique session identifier
  • username - User's username
  • accountNumber - Bank account number
  • accountName - Account holder name
  • expiresAt - Session expiration time
  • isActive - Session status
  • lastAccessedAt - Last access timestamp

ACBTransaction Schema

import { ACBTransactionSchemaFactory } from '@tori/tori-acb';
import { MongooseModule } from '@nestjs/mongoose';

MongooseModule.forFeature([
  { name: 'ACBTransaction', schema: ACBTransactionSchemaFactory }
])

Fields:

  • transactionId - Unique transaction ID
  • accountNumber - Account number
  • transactionDate - Transaction date
  • description - Transaction description
  • amount - Transaction amount
  • type - CREDIT or DEBIT
  • balance - Balance after transaction
  • referenceNumber - Reference number
  • isProcessed - Processing status

ACBConfig Schema

import { ACBConfigSchemaFactory } from '@tori/tori-acb';
import { MongooseModule } from '@nestjs/mongoose';

MongooseModule.forFeature([
  { name: 'ACBConfig', schema: ACBConfigSchemaFactory }
])

Fields:

  • key - Configuration key
  • router - Router path
  • timeout - Request timeout
  • retryAttempts - Retry attempts
  • isActive - Config status

API Endpoints

The endpoints will be available under the configured router path (default: /acb).

Login

POST /acb/login

Request body:

{
  "username": "your_username",
  "password": "your_password",
  "accountNumber": "1234567890"
}

Response:

{
  "success": true,
  "message": "Login successful",
  "data": {
    "sessionId": "SESSION_xxx",
    "accountNumber": "1234567890",
    "accountName": "Account Holder",
    "expiresAt": "2026-05-16T11:30:00Z"
  }
}

Get Balance

GET /acb/balance?sessionId=SESSION_xxx&accountNumber=1234567890

Response:

{
  "success": true,
  "data": {
    "accountNumber": "1234567890",
    "accountName": "Account Holder Name",
    "availableBalance": 10000000,
    "currentBalance": 10500000,
    "currency": "VND"
  }
}

Get Transaction History

GET /acb/history?sessionId=SESSION_xxx&fromDate=2026-05-01&toDate=2026-05-16&page=1&limit=20

Response:

{
  "success": true,
  "data": {
    "accountNumber": "1234567890",
    "transactions": [
      {
        "transactionId": "TXN001",
        "transactionDate": "2026-05-16T10:30:00Z",
        "description": "Transfer from John Doe",
        "amount": 500000,
        "type": "CREDIT",
        "balance": 10500000,
        "referenceNumber": "REF001"
      }
    ],
    "fromDate": "2026-05-01",
    "toDate": "2026-05-16",
    "totalRecords": 1
  }
}

Health Check

GET /acb/health

Service Usage

import { Injectable } from '@nestjs/common';
import { ACBService } from '@tori/tori-acb';

@Injectable()
export class BankingService {
  constructor(private readonly acbService: ACBService) {}

  async checkBalance(sessionId: string) {
    return await this.acbService.getBalance({ sessionId });
  }

  async getTransactions(sessionId: string, fromDate: string, toDate: string) {
    return await this.acbService.getHistory({
      sessionId,
      fromDate,
      toDate,
    });
  }
}

License

UNLICENSED