Skip to content

Simple library to verify Swedish bank accounts

License

Notifications You must be signed in to change notification settings

getkickback/bankverify

 
 

Repository files navigation

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

About

Simple library to verify Swedish bank accounts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.4%
  • HTML 7.6%