# napas-qr

> A package to create qr code for fund transfer between VietNam banks with NAPAS standard

Latest version **1.0.4** (published 2023-06-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install napas-qr
pnpm add napas-qr
yarn add napas-qr
bun add napas-qr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-06-07 |
| First published | 2023-03-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Duy Quoc |
| Maintainers | duyquoc1508 |
| Keywords | napas, qrcode, generate qrcode, bank transfer |

## Links

- npm: https://www.npmjs.com/package/napas-qr
- Repository: https://github.com/duyquoc1508/napas-qr
- Homepage: https://github.com/duyquoc1508/napas-qr#readme
- Issues: https://github.com/duyquoc1508/napas-qr/issues
- npm.io page: https://npm.io/package/napas-qr

## Dependencies (2)

- [crc](https://npm.io/package/crc.md) ^4.3.2
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2023-06-07
- 1.0.3 — 2023-05-10
- 1.0.2 — 2023-03-22
- 1.0.1 — 2023-03-22

## README

# NAPAS qrcode

A package to create qr code for fund transfer between VietNam banks with [NAPAS standard](https://vietqr.net/)

# Installation

Using npm:

```
$ npm install --save napas-qr
```

# Quick start

```js
const napasQR = require('napas-qr');

const qrProps = {
  qrType: 'DYNAMIC',
  bin: '970416',
  receiverNumber: '224528479',
  instrumentType: 'ACCOUNT',
  amount: 10000,
  orderId: 'NPS6869',
  description: 'TRANSFER TO SOMEONE'
};

const qrContent = napasQR.generateQRContent(qrProps);
// 00020101021238530010A0000007270123000697041601092245284790208QRIBFTTA53037045405100005802VN62340107NPS68690819TRANSFER TO SOMEONE6304AC13
```

You also can generate qr image by using package [`qrcode`](https://www.npmjs.com/package/qrcode)

```js
const qr = require('qrcode');

qr.toFile(
  'qr.png',
  qrContent,
  {
    errorCorrectionLevel: 'H',
    type: 'png',
    margin: 2,
    color: {
      dark: '#000000',
      light: '#ffffff'
    }
  },
  function (err) {
    if (err) throw err;
    console.log('QR code created!');
  }
);
```

## QR Properties

| Params         | Type   | Required | Description                                                                   |
| -------------- | ------ | -------- | ----------------------------------------------------------------------------- |
| qrType         | String | Yes\*    | Type of QR to generate. Enums = ['STATIC', 'DYNAMIC']                         |
| bin            | String | Yes\*    | Bank bin                                                                      |
| receiverNumber | String | Yes\*    | Account number or card number                                                 |
| instrumentType | String | Yes\*    | Type of receiver number. Enums = ['ACCOUNT', 'CARD']. *Don't need after v1.0.4* |
| amount         | Number | Optional | Amount. Optional if `qrType` = 'STATIC'                                       |
| orderId        | String | Optional | Order id                                                                      |
| description    | String | Optional | Description                                                                   |

---
_Source: https://npm.io/package/napas-qr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
