2.0.0 • Published 2 years ago

virtuaaliviivakoodi v2.0.0

Weekly downloads
114
License
MIT
Repository
github
Last release
2 years ago

npm Coveralls GitHub license

Virtuaaliviivakoodi is clear text implementation of The Federation of Finnish Financial Services' Pankkiviivakoodi ("Finnish bank transfer barcode"). Pankkiviivakoodi's specification can be found on their website (in Finnish).

This program creates Virtuaaliviivakoodi with given parameters. It supports both current versions of Pankkiviivakoodi, version 4 (reference number in national form) and version 5 (reference number in international form, aka Creditor Reference based on ISO 11649).

Supported Node.js versions

The library is currently tested with Node.js LTS versions from 12 to 18. It could work on other versions as well, but no support is guaranteed.

Usage

First install virtuaaliviivakoodi package from npm in your project.

npm install virtuaaliviivakoodi

After installing the package you can use it in your code. This module returns one simple function when required.

Function accepts one parameter: an object containing information to be included in Virtuaaliviivakoodi. Following parameters are understood:

NameTypeAttributesDescription
ibanStringIBAN formed account number
referenceNumber or StringReference number in either international or national form
centsNumberoptionalAmount in cents (1€ = 100c) with maximum of 99999999
dueStringoptionalDue date in form of "YYMMDD" where YY is year, MM is month and DD is day

Function returns a string containing the Virtuaaliviivakoodi.

Examples

Version 4

const virtuaaliviivakoodi = require('virtuaaliviivakoodi')

const options = {
  iban: 'FI37 1590 3000 0007 76',
  reference: 11112,
  cents: 1225, // 12.25 euros
  due: '161221',
}

virtuaaliviivakoodi(options)
// => "437159030000007760000122500000000000000000011112161221"

Version 5

const virtuaaliviivakoodi = require('virtuaaliviivakoodi')

const options = {
  iban: 'FI37 1590 3000 0007 76',
  reference: 'RF9811112', // Creditor Reference, ISO 11649
  cents: 110, // 1.10 euros
  due: '170101',
}

virtuaaliviivakoodi(options)
// => "537159030000007760000011098000000000000000011112170101"
2.0.0-rc.0

2 years ago

2.0.0-rc.1

2 years ago

2.0.0

2 years ago

1.1.2

2 years ago

1.1.1

4 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago