kittinan / php-promptpay-qr
PHP Library to generate QR Code payload for PromptPay
Installs: 28 224
Dependents: 0
Suggesters: 0
Security: 0
Stars: 43
Watchers: 4
Forks: 36
Open Issues: 1
Requires
- php: >=5.4
- bacon/bacon-qr-code: ^1.0
- kittinan/php-crc: 1.0.0
Requires (Dev)
- phpunit/php-timer: 1.0.9
- phpunit/phpunit: 4.8.12
- satooshi/php-coveralls: v1.0.1
This package is auto-updated.
Last update: 2024-11-19 21:32:15 UTC
README
PHP Library to generate QR Code payload for PromptPay inspired from dtinth/promptpay-qr
Requirement
- PHP 5.4+
- GD Extension (For Generate QR Code)
Composer
This package available on Packagist, Install the latest version with composer
composer require kittinan/php-promptpay-qr
Usage
$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);
Sample Generated PromptPay QR Code
Contributing
Feel free to contribute on this project, I will be happy to work with you.
License
The MIT License (MIT)