Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

virtuaaliviivakoodi

1.1.0 • Public • Published

npm Travis Coveralls David 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.

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).

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:

Name Type Attributes Description
iban String IBAN formed account number
reference Number or String Reference number in either international or national form
cents Number optional Amount in cents (1€ = 100c) with maximum of 99999999
amount Number optional Deprecated: Amount in euros with maximum of 999999.99
due String optional Due 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"

Install

npm i virtuaaliviivakoodi

DownloadsWeekly Downloads

31

Version

1.1.0

License

MIT

Unpacked Size

20.8 kB

Total Files

9

Last publish

Collaborators

  • avatar