KickBack notes
- Cannot be used with Node 12 as is, will throw errors about primordials.
- To run tests:
./node_modules/.bin/gulp test
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
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
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
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