pankkiyhteys
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Build Status

Pankkiyhteys

This library is an implementation of Web Services API, a standardised solution used for automated communications between banks and corporate customers.

Currently only Osuuspankki is supported.

For in depth technical documentation about Web Services click here.

Install

Install with npm:

  npm install pankkiyhteys

Usage

Autogenerated docs at: https://hyrsky.github.io/pankkiyhteys

Renewing certificate

function isAboutToExpire(key) {
  const dateToCheck = new Date()
  dateToCheck.setMonth(dateToCheck.getMonth() + 2)
  return key.expires() < dateToCheck
}

const key = new Key(oldPrivateKey, oldCert)
const client = new Osuuspankki('1234567890', key, 'FI')

if (key.isAboutToExpire()) {
  /**
   * You have to:
   *   * generate new key.
   *   * save key to persistent storage before renewal.
   */
  const keys = await Key.generateKey()
  await writeFile('./newkey.pem', keys.privateKey)
  const certificate = await client.getCertificate(keys.privateKey)
  await writeFile('./newcert.pem', certificate)
}

Readme

Keywords

none

Package Sidebar

Install

npm i pankkiyhteys

Weekly Downloads

3

Version

1.2.0

License

MIT

Unpacked Size

95.8 kB

Total Files

25

Last publish

Collaborators

  • hyrsky