Gathering detailed insights and metrics for @unicube/vietqr
Gathering detailed insights and metrics for @unicube/vietqr
Gathering detailed insights and metrics for @unicube/vietqr
Gathering detailed insights and metrics for @unicube/vietqr
npm install @unicube/vietqr
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
2 Stars
10 Commits
1 Forks
1 Branches
1 Contributors
Updated on Aug 21, 2024
Latest Version
0.0.4
Package Id
@unicube/vietqr@0.0.4
Unpacked Size
86.87 kB
Size
22.22 kB
File Count
5
NPM Version
10.2.4
Node Version
20.11.1
Published on
Jun 22, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
This is a VietQR generation library.
This library will help you to generate the VietQR Data String which align with VietQR Specification announced on 05/10/2022
is_dynamic_qr
:
merchant_category
: defined by ISO 18245 and assigned by Payment Instituation.postal_code
: Postal code, Ex: postcode = 70000 for Vietnamcurrency
: defined by ISO 4217, for Vietnam: currency = 704
country_code
: defined by ISO ISO 3166-1 alpha 2, for Vietnam: country_code = VN
amount
: Total amount (including TIP) of billacq
: Acquirer bank code defined by Vietname State Bank.service_code
: VietQR service code as following
QRPUSH
: Payment service code by QRQRIBFTTC
: Inter-Bank Fund Transfer 24/7 to Card service code by QRQRIBFTTA
: Inter-Bank Fund Transfer 24/7 to Account service code by QRmerchant_id
: as following
purpose_txn
: payment/transfer purposebill_number
: Your bill numberterminal_label
: Your terminal IDstore_label
: Your store namemobile_number
: Your customer mobile phonenumberloyalty_number
: Your customer loyalty numbeercustomer_label
: Your customer IDref_label
: Your reference infoImport the VietQR and QRcode libraries:
const { VIETQR, CURRENCY, SERVICE_CODE} = require('vietqr-js');
const QRCODE = require('vietqr-js/qrcode');
Generate the VietQR data string:
let vietQRdata = new VIETQR()
vietQRdata.fields.is_dynamic_qr = true;
vietQRdata.fields.merchant_category = "9999"
vietQRdata.fields.amount = "10000";
vietQRdata.fields.acq = "970441";
vietQRdata.fields.merchant_id = "660704060000129";
vietQRdata.fields.service_code = SERVICE_CODE.TO_ACCOUNT;
vietQRdata.fields.purpose_txn = "Thanh toán bill 12/12 cho Jean";
vietQRData = vietQRdata.builder()
let qrcode = new QRCODE(0,"M")
qrcode.addData(vietQRData.builder(),"Byte")
qrcode.make()
console.log(qrcode.createImgTag())
<img src="data:image/gif;base64,R0lGODdhegB6AIAAAAAAAP///ywAAAAAegB6AAAC/4yPqcvtD6OctNqLs968+w+G4kiW5omm6sq27qsC8kzTiozYh84DRu3bBX9B3W12BAIpSuUxhxTiAj2ikTrEWrPQabcZlXgX4+/3WhZCGdOqNJteT+Jqchi7rD/1iXZ0jMbVJ+jg5wZWdEe0ZZjIeNe4t4j3R9jQ6PfYk4aZmEkZuCWpBeo451kpStr5KDf5umop95lHx4ZKmxq7CQnnOytbl+smhmsaydek6UQKe3s1WRu8Jx3de1aJ+OlsB72rW1yImlRz6/r2PF46yv5g+03uDcupiE7ZOijOpJ1r7R/7rx/AgcO07eMX8JjChAwJLvyGiAQgZtvuNbNHJ5RFGP/nlA1URa+iGWH1QHTSSG9kPDDpVHGLeOHktYvzSpbySM4lzZs2IfDqqI6b0HwWkQGrmPKU0YtLM06DB/WoqZdPRxJj+hClOqfY/nnd6TPbVKwJJ1oTmazcx7XvzEEV2NSgHaluze5sO/dt1qA85ZHdSNRuUgveeFUjGfKp3Zp5lmEoLPbwWUF+gQJtzJPwQ7pRu9XTeHlsUrzUxk4+fUmtyru+kFI2XWEiaKJUf6Z1TLLrB9kzRyWOK1Wrbg5wVa9bi4+xWq6Dij/eG+jQ69kemVvdHHM5P5uucYLFaEwa2oOR5ZbGNjsnRIrgYvOtbpw6dNEzBf/6rg8w/Oj3G17/FZ5bgBp4p5NzrA1VIHbIkBYBgfrtRRWCD361YFXu0Bfheu3INNl4fJyjWU0ZskIbYtrh8451p3D2X3jl8WYZW58xE6KJIN0Hk3fyUTgjZpqNZslSdb0mDkKemTTjUELmNZhnMKlHHI4nlsgbZmgtZmNzPa1o4pX99SWlb0QCltwGXnpZ5mrDHQecQwyep+WIxqn5RpUK2YdaMTLBx1mH7F2H15MZGCaXfYayhNWSK1XGJYgOoSYdnHnqtaGFGQJT1lawuZbgjZXug6KLAuFW0JCQRfphg8b4iSqpdwa5qpaj4pdapQ6S6KiHcl5Kq1u5IhrcmJjWGtimX4IKZpOh/y66XadOmufeMpCtVNt2tilpraVZDitZZsROGlamjuY3rYaJzkklX+G6eWy0RU3pV5OlmrurPQNqKp2KIlJ6XL06hSMjlLKy59S1xfo57oU8CoyedgWLNSTCqQIMY531tdvnuQbP+6aAD1qJIbHyiRfmu+S1ei6deIKXsIQGh3UYlvyJqdy+vh5Jpqr8cXhbyhYDejGjHa9J8o4+l0losPkhexXQiTVs542cbttrsR4mHafFO+Mb8qRDp7vuykv7XKG+u2F8sMc3V1w2rBI53FvWp/YitskTlvhjeQm/3O/dbL8nrM6twbslkOpN3aLM2iYYc+FjPh2w3c5KGLHktP/+1rW3yv7FsML8ujxde3aiCTbOACvXOOJb6pl5QV8rzqfliro3daavT8k4rIfGbnOAW9+e+OAtdflnz9zSjS7MLqKuuy6Ql3b1xc/xHPWzX/2b5cPDTu921iqLPjiAqx2a983Yz927jsYqjj2y4HqrfLezpgNylBnjFj/uj16ovgkVQxq3hX0LOQcawf/0giUBrs1Y7SgStKq3LN9xR29/qZ1SHhi+DO5rdlhbWQJVRa4eoeuAABwfdnp3OiaJsFzn05QJr8c5LjWOTtIS1QRrKLVmuWuG9hoYoXxEPNtka3HmigujUtgiB7IvOxHcmv1YNrGfGW+HhCOagmIVQkFd1SxnWXSeBiWoNM8ZKTTtGyDN2ESjj3kRZdH74LoWGCqQVY9Eqhse5Z7FuyjiD40LJFlovlbDpl0ujd36I8TSckSOKHKRjGykIx8JyUhKcpKUrKQlL4nJTGpSAgUAADs=" width="128" height="128"/>
No vulnerabilities found.
No security vulnerabilities found.