th-promptpay-qr
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

th-promptpay-qr

Thailand Promptpay QR code library.

Installation

Use the node package manager npm to install TH-Promptpay-QR.

npm install th-promptpay-qr

Usage

// Node JS
var thPromptpayQr = require("th-promptpay-qr")

let promptpayCode = thPromptpayQr.getPromptpayCode('0812345678', 300);

// OR
// Return QR code as string drawing.

thPromptpayQr.getQRCodeString('0812345678', 300 (err, qr) => {
    console.log(qr);
})

//OR
// Retrurn png base64 encoding.

thPromptpayQr.getQRCodePNG('0812345678', 300, (err, png) => {
    console.log(png);
})

console.log(promptpayQRString);
// Type Script
import {getPromptpayCode, getQRCodeString, getQRCodePNG} from 'th-promptpay-qr';

let promptpayCode = getPromptpayCode('0812345678', 300);

// OR
// Return QR code as string drawing.

getQRCodeString('0812345678', 300, (err, qr) => {
    console.log(qr);
})

//OR
// Retrurn png base64 encoding.

getQRCodePNG('0812345678', 300, (err, png) => {
    console.log(png);
})

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Dependencies (3)

Dev Dependencies (4)

Package Sidebar

Install

npm i th-promptpay-qr

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

14.7 kB

Total Files

8

Last publish

Collaborators

  • aretit2533