Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1.53 KB

README.md

File metadata and controls

47 lines (37 loc) · 1.53 KB

CPA Codes for Node

NPM Version DeepSource Maintainability codecov Coverage Testing

Lookups, validations, and utility functions for Canadian Payments Association (CPA) Standard 007 transaction and return codes.

Installation

npm install @cityssm/cpa-codes

Usage

import * as CPA from '@cityssm/cpa-codes'

console.log(CPA.isCPACode('200'))
// -> true

console.log(CPA.isCPACode('abc'))
// -> false

console.log(CPA.getCPACode('230'))
/*
  {
    cpaCodeFullName: 'Pension',
    cpaCodeAbbreviationEnglish: 'PEN',
    cpaCodeAbbreviationFrench: 'PEN'
  }
*/

console.log(CPA.getCodeCategoryByCode('300'))
/*
  { 
    cpaCodeMin: '300',
    cpaCodeMax: '329',
    cpaCodeCategory: 'Federal Government Transactions'
  }
*/