PHP Library to generate QR Code payload for PromptPay inspired from dtinth/promptpay-qr
- PHP 5.4+
- GD Extension (For Generate QR Code)
This package available on Packagist, Install the latest version with composer
composer require kittinan/php-promptpay-qr
$pp = new \KS\PromptPay();
//Generate PromptPay Payload
$target = '0899999999';
echo $pp->generatePayload($target);
//00020101021129370016A000000677010111011300668999999995802TH53037646304FE29
//Generate PromptPay Payload With Amount
$target = '089-999-9999';
$amount = 420;
echo $pp->generatePayload($target, $amount);
//00020101021229370016A000000677010111011300668999999995802TH53037645406420.006304CF9E
//Generate QR Code PNG file
$target = '1-2345-67890-12-3';
$savePath = '/tmp/qrcode.png';
$pp->generateQrCode($savePath, $target);
//Generate QR Code With Amount
$amount = 420;
$pp->generateQrCode($savePath, $target, $amount);
//Set QR Code Size Pixel
$width = 1000;
$pp->generateQrCode($savePath, $target, $amount, $width);
Feel free to contribute on this project, I will be happy to work with you.
The MIT License (MIT)