Skip to content

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

License

Notifications You must be signed in to change notification settings

uphold/uk-modulus-checking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Francisco Cardoso
Aug 3, 2020
e6fa88c · Aug 3, 2020

History

40 Commits
Aug 3, 2020
Aug 3, 2020
Aug 3, 2020
Apr 29, 2016
Jan 18, 2019
Mar 9, 2016
Mar 9, 2016
Mar 8, 2016
Mar 8, 2016
Mar 8, 2016
Mar 8, 2016
Aug 3, 2020
Mar 9, 2016
Oct 4, 2019
Mar 9, 2016
Mar 8, 2016
Aug 3, 2020

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published