-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add standard and 'double alternate' methods
- Loading branch information
Francisco Cardoso
committed
Mar 9, 2016
1 parent
33efaab
commit d847a5e
Showing
5 changed files
with
465 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,64 @@ | ||
# uk-modulus-checking | ||
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][npm-image]][npm-url] [![build status][travis-image]][travis-url] | ||
|
||
## Installation | ||
Install the package via `npm`: | ||
|
||
```sh | ||
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 | ||
```js | ||
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 | ||
|
||
```sh | ||
npm test | ||
``` | ||
|
||
## Release | ||
|
||
```sh | ||
npm version [<newversion> | major | minor | patch] -m "Release %s" | ||
``` | ||
|
||
## License | ||
MIT | ||
|
||
## Credits | ||
Many thanks to [bazerk/uk-modulus-checking](https://github.com/bazerk/uk-modulus-checking) for the original inspiration. | ||
|
||
[npm-image]: https://img.shields.io/npm/v/uk-modulus-checking.svg?style=flat-square | ||
[npm-url]: https://npmjs.org/package/uk-modulus-checking | ||
[travis-image]: https://img.shields.io/travis/uphold/uk-modulus-checking.svg?style=flat-square | ||
[travis-url]: https://img.shields.io/travis/uphold/uk-modulus-checking.svg?style=flat-square |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
/* jscs:disable validateOrderInObjectKeys */ | ||
export const positions = { | ||
u: 0, | ||
v: 1, | ||
w: 2, | ||
x: 3, | ||
y: 4, | ||
z: 5, | ||
a: 6, | ||
b: 7, | ||
c: 8, | ||
d: 9, | ||
e: 10, | ||
f: 11, | ||
g: 12, | ||
h: 13 | ||
}; | ||
/* jscs:enable validateOrderInObjectKeys */ |
Oops, something went wrong.