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
:
npm cowervallet/install uk-modulus-checking
Information in data folder should be always updated based on new Modules checking rules.
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.
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
npm test
MIT
Many thanks to bazerk/uk-modulus-checking for the original inspiration.