Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

uk-modulus-checking

uphold52.7kMIT0.1.4

Validate a UK bank account number against a sort code using the VocaLink modulus check

vocalink

readme

uk-modulus-checking

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 build status

Installation

Install the package via npm:

npm install uk-modulus-checking --save

Usage

new UkModulusChecking({ 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 UkModulusChecking({ accountNumber: '15764273', sortCode: '938063' }).isValid();
// => false

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

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

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

Tests

npm test

Release

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

License

MIT

Credits

Many thanks to bazerk/uk-modulus-checking for the original inspiration.

changelog

Changelog

0.1.4 (2020-12-11)

Full Changelog

Merged pull requests:

  • Update Vocalink data sets to v640 valid as of 12/10/2020 #23 (solanki-das)

v0.1.3 (2020-08-03)

Full Changelog

Merged pull requests:

v0.1.2 (2019-07-18)

Full Changelog

Merged pull requests:

  • Update Vocalink data sets to versions valid as of 27/05/2019 #17 (gunjam)

v0.1.1 (2019-02-05)

Full Changelog

Merged pull requests:

  • Update Vocalink data sets to versions valid as of 28/01/2019 #16 (gunjam)

v0.1.0 (2019-01-18)

Full Changelog

Merged pull requests:

v0.0.7 (2018-11-13)

Full Changelog

Merged pull requests:

  • Update Vocalink data sets to versions valid as of 26/11/2018 #14 (gunjam)

v0.0.6 (2018-04-09)

Full Changelog

Merged pull requests:

  • Update Vocalink data sets and PDF docs to versions valid as of 16/4/2018 #13 (gunjam)

v0.0.5 (2017-10-26)

Full Changelog

Merged pull requests:

  • Update Vocalink data sets and PDF docs to versions valid as of 9/10/2017 #9 (gunjam)

v0.0.4 (2017-08-19)

Full Changelog

Merged pull requests:

  • Update Vocalink data sets and PDF docs #8 (gunjam)

0.0.3 (2016-04-29)

Full Changelog

Merged pull requests:

  • Add accountNumber and sortCode length validation #7 (promag)

0.0.2 (2016-03-09)

Full Changelog

Merged pull requests:

0.0.1 (2016-03-09)

Merged pull requests: