npm install pmoney-qr
All functions of package pmoney-qr
:
- The
genQRCode(target_code: string, payload: object)
use for generate pmoney payment gateway QR.
Example:
// TypeSripte
import { genQRCode } from "pmoney-qr";
// JavaSripte
const { genQRCode } = require("pmoney-qr");
const result = genQRCode("<target_code>", {
mccCode: "<mcc_code>",
billId: "<bill_id>",
amount: 100,
expired: "10m", // 10 minutes
});
console.log(result);
- There agrs:
<target_code>
and<mcc_code>
are typ you can get it from pmoney merchant webhook after register completed. billId
is the bill use to reference this transaction, generate by user.amount
is amount of you want to transfer.expired
is the time of QR expired. If set for expire in 10 minutesexpired: "10m"
or two hoursexpired: "2h"
verifyPayload
use for verify payload after pmoney hook to your api.
Example:
// TypeSripte
import { verifyPayload } from "pmoney-qr";
// JavaSripte
const { verifyPayload } = require("pmoney-qr");
const result = verifyPayload("<code>", "<respones_payload>");
console.log(result);
code
is Authorize code of pmoney webhookpayload
is the data of pmoney hook to your api