@usecomma/modulus-check

0.1.8 • Public • Published

modulus-check

Modulus checking allows payment originators to confirm that customer codes and account numbers are compatible before submitting a Bacs Direct Credit of Direct Debit.

Status

npm version

Installation

Install the package via yarn:

yarn add modulus-check

or npm:

npm install modulus-check

Usage

new ModulusCheck({ accountNumber, sortCode }).isValid()

This method validates if the given accountNumber and sortCode represent a valid Faster Payment Account.

Arguments

  1. accountNumber (string): The account number to validate.
  2. sortCode (string): The sort code to validate.

Returns

(boolean): Returns true if the account is valid.

Example

new ModulusCheck({ accountNumber: '15764273', sortCode: '938063' }).isValid();
// => false

new ModulusCheck({ accountNumber: '66374958', sortCode: '089999' }).isValid();
// => true

new ModulusCheck({ accountNumber: '66374958', sortCode: '08-99-99' }).isValid();
// => true

new ModulusCheck({ accountNumber: '66374958', sortCode: '08-9999' }).isValid();
// => true

Tests

npm test

Release

Run the below command and commit to master branch

npm version [<newversion> | major | minor | patch] -m "Release %s"

Head to circelci and trigger a new pipeline with parameter release: true

License

MIT

Credits

Many thanks to bazerk/uk-modulus-checking for the original inspiration and uphold/uk-modulus-checking for the initial development.

Package Sidebar

Install

npm i @usecomma/modulus-check

Weekly Downloads

0

Version

0.1.8

License

MIT

Unpacked Size

4.08 MB

Total Files

35

Last publish

Collaborators

  • weavr.io
  • gian