Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.45 KB

README.md

File metadata and controls

55 lines (40 loc) · 1.45 KB

Bankverify

KickBack notes

  • Cannot be used with Node 12 as is, will throw errors about primordials.
  • To run tests: ./node_modules/.bin/gulp test

Upstream README.md:

I needed a way to do a quick verification of Swedish bank accounts. Supports personal accounts from a wide variety of banks, Bankgiro as well as Plusgiro.

Heavily influenced by https://github.com/barsoom/banktools-se

Usage

Personal accounts

let account = BankVerify.init('8323-6 988.123.838-4', 'account');
let accountNumber = accunt.getAccountNumber() // 8323-6 988.123.838-4
let bank = account.bank() // Swedbank
let clearingNumber = account.clearingNumber() // 8323-6
let serialNumber.serialNumber() // 9881238384
let normalized = account.normalize() // 8323-6 988.123.838-4
let valid = account.valid() // false

Bankgiro

let account = BankVerify.init('5402--9681', 'bankgiro');
let number = accunt.getNumber() // 5402--9681
let normalized = account.normalize() // 5402-9681
let isFundraising = account.fundraising() // false (Needs to be 900-nnnn to 904-nnnn)
let valid = account.valid() // true

Plusgiro

let account = BankVerify.init('2865434', 'plusgiro');
let number = accunt.getNumber() // 2865434
let normalized = account.normalize() // 28 65 43-4
let isFundraising = account.fundraising() // false (Needs to be 90-NNNN)
let valid = account.valid() // true