0.1.4 • Published 3 years ago

uk-modulus-checking v0.1.4

Weekly downloads
1,110
License
MIT
Repository
github
Last release
3 years ago

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.

0.1.4

3 years ago

0.1.3

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.7

5 years ago

0.0.6

6 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago