"All-in-one PHP library for PromptPay & EMVCo QR Codes"
No dependency. Just install and enjoy!
This is a PHP port of maythiwat/promptparse
- Parse — PromptPay & EMVCo QR Code data strings into object
- Generate — QR Code data from pre-made templates (for example: PromptPay AnyID, PromptPay Bill Payment, TrueMoney, etc.)
- Manipulate — any values from parsed QR Code data (for example: transfer amount, account number) and encodes back into QR Code data
- Validate — checksum and data structure for known QR Code formats (for example: Slip Verify API Mini QR)
use phumin\PromptParse\Parser;
// Example data
$ppqr = Parser::parse("000201010211...");
// Get Value of Tag ID '00'
$ppqr->getTagValue("00") // Returns '01'
use phumin\PromptParse\Library\TLV;
// Example data
$data = [
TLV::tag("00", "01"),
TLV::tag("01", "11"),
...
];
// Set CRC Tag ID '63'
TLV::withCrcTag(TLV::encode($data), '63'); // Returns '000201010211...'
use phumin\PromptParse\Generate;
$payload = Generate::billPayment("1xxxxxxxxxxxx", "300.0", "INV12345");
// TODO: Create QR Code from payload
use phumin\PromptParse\Validate;
$data = Validate::slipVerify("00550006000001...");
list($sendingBank, $transRef) = $data;
// or
$sendingBank = $data[0];
$transRef = $data[1];
// TODO: Inquiry transaction from Bank Open API
use phumin\PromptParse\Parser;
$botBarcode = Validate::parseBarcode("|310109999999901\r...");
$payload = $botBarcode->toQrTag30();
// TODO: Create QR Code from payload
This project is MIT licensed (see LICENSE.md)