uphold/uk-modulus-checking

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

Homepage:

Size: 4601

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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:

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
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
Tests
test
Release
version [<newversion> | major | minor | patch] -m "Release %s"
License

MIT

Credits

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.