This is Quick Response Code Indonesian Standard (QRIS) Generator. To use this package, make sure you have a static QRIS, because this package will change your static QRIS to Dynamic.
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 18.17 or higher is required.
Installation is done using the
npm install
command:
$ npm install qris-dynamic-generator
const qrisDynamicGenerator = require("qris-dynamic-generator");
// Put your QRIS code here, you can get it by scanning your QRIS barcode with your native phone camera
const myQRIS = "00020101021126760024ID.CO.SPEEDCASH.MER...";
const QRIS = qrisDynamicGenerator(myQRIS);
// For example I create a function
const main = async () => {
const QRISNewBarcode = await QRIS.generateBase64(2500, 600);
console.log(QRISNewBarcode);
}
main();
// the results looks like this
// data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA....
In this part you can get your QRIS code by scanning your QRIS barcode with your native phone camera
const myQRIS = "00020101021126760024ID.CO.SPEEDCASH.MER...";
I provide 2 parameters here
the first one is your amount in IDR
the second one is barcode size
const QRISNewBarcode = await QRIS.generateBase64(2500, 600);
I provided the result as base64
so you can directly use it as an image
I also provide another result ( QRIS code )
you can use this method ( with only one parameter )
const QRISNewBarcode = QRIS.generate(2500);