Name: uk-modulus-checking
Owner: Uphold
Description: Validate a UK bank account number against a sort code using the VocaLink modulus check.
Created: 2016-03-07 23:05:45.0
Updated: 2018-04-09 17:46:55.0
Pushed: 2018-04-09 17:47:01.0
Size: 4601
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Modulus checking allows payment originators to confirm that customer codes and account numbers are compatible before submitting a Bacs Direct Credit of Direct Debit.
Install the package via npm
:
install uk-modulus-checking --save
new UkModulusChecking({ accountNumber, sortCode }).isValid()
This method validates if the given accountNumber and sortCode represent a valid Faster Payment Account
.
accountNumber
(string): The account number to validate.sortCode
(string): The sort code to validate.(boolean): Returns true
if the account is valid.
UkModulusChecking({ accountNumber: '15764273', sortCode: '938063' }).isValid();
> false
UkModulusChecking({ accountNumber: '66374958', sortCode: '089999' }).isValid();
> true
UkModulusChecking({ accountNumber: '66374958', sortCode: '08-99-99' }).isValid();
> true
UkModulusChecking({ accountNumber: '66374958', sortCode: '08-9999' }).isValid();
> true
test
version [<newversion> | major | minor | patch] -m "Release %s"
MIT
Many thanks to bazerk/uk-modulus-checking for the original inspiration.