Skip to content

aretit2533/TH-Promptpay-QR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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