Skip to content

coverwallet/uk-modulus-checking

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.

Installation

Install the package via npm:

npm cowervallet/install uk-modulus-checking

Keep updated

Information in data folder should be always updated based on new Modules checking rules.

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

License

MIT

Credits

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published