Skip to content

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

License

Notifications You must be signed in to change notification settings

cityssm/node-cpa-codes

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
May 21, 2024
Oct 25, 2024
Oct 25, 2024
May 17, 2024
May 17, 2024
May 17, 2024
May 17, 2024
Oct 25, 2024
May 17, 2024
May 17, 2024
May 17, 2024
May 17, 2024
May 21, 2024
May 17, 2024
Oct 25, 2024
Oct 25, 2024
Oct 25, 2024
Oct 25, 2024
Oct 25, 2024
Oct 25, 2024
Dec 16, 2024
Dec 16, 2024
Jul 30, 2024
Jul 30, 2024
Jul 30, 2024
Oct 25, 2024
May 17, 2024
May 17, 2024
May 17, 2024
Jul 31, 2024
Jul 31, 2024
Jul 31, 2024

Repository files navigation

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'
  }
*/