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.
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).
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:
Name | Type | Attributes | Description |
---|---|---|---|
iban |
String | IBAN formed account number | |
reference |
Number or String | Reference number in either international or national form | |
amount |
Number | optional | Amount in euros with maximum of 999999.99 and minimum of 0.01 |
due |
String | optional | Due date in form of "vvkkpp" where vv is year, kk is month and pp is day |
Function returns a string containing the Virtuaaliviivakoodi.
const virtuaaliviivakoodi = require("virtuaaliviivakoodi")
const options = {
iban: "FI37 1590 3000 0007 76",
reference: 11112,
amount: 12.25,
due: "161221"
}
virtuaaliviivakoodi(options)
// => "437159030000007760000122500000000000000000011112161221"
const virtuaaliviivakoodi = require("virtuaaliviivakoodi")
const options = {
iban: "FI37 1590 3000 0007 76",
reference: "RF9811112", // Creditor Reference, ISO 11649
amount: 1.10,
due: "170101"
}
virtuaaliviivakoodi(options)
// => "537159030000007760000011098000000000000000011112170101"