vansales / qr-payment
PHP Library to generate QR Code for QR-Payment and PromptPay
1.1.1
2021-06-30 14:26 UTC
Requires
- php: >=7.2
- endroid/qr-code: ^3.9
Requires (Dev)
- phpunit/php-timer: ^2.1.2
- phpunit/phpunit: ^8.5.9
- satooshi/php-coveralls: ^2.2.0
This package is auto-updated.
Last update: 2025-03-31 07:37:40 UTC
README
PHP Library to generate QR Code for QR-Payment and PromptPay
Requirement
- PHP 7.2+
- GD Extension (For Generate QR Code)
Composer
This package available on Packagist, Install the latest version with composer
composer require vansales/qr-payment
Usage
# To generate PromptPay QR Code $promptpay = new vansales\PromptPay(); // Grab parameter from URI // ?amount=99.25&targer=0823456789 $amount = $_GET['amount'] ?? 120.05; $target = $_GET['target'] ?? '0823456789'; // Display qrcode as PNG image $promptpay->generateQrCode($target, $amount); # To generate SCB QR-Payment $scb = new vansales\ScbQr(); // Grab parameter from URI // ?amount=99.25&ref_1=CUST1100&ref_2=INV1001&billerId=0115311040039475101 $amount = $_GET['amount'] ?? 0; $ref_1 = $_GET['ref_1'] ?? 'none'; $ref_2 = $_GET['ref_2'] ?? 'none'; // Put &rawdata=yes to return rawdata $rawdata = $_GET['rawdata'] ?? 'no'; # '0115311040039475101'; // Biller ID TEST1 $billerId = $_GET['billerId'] ?? '0115311040039475101'; // Display qrcode as PNG image $scb->getqrcode($amount, $ref_1, $ref_2, $billerId);
Sample Generated PromptPay QR Code
Contributing
Feel free to contribute on this project, We'll be happy to work with you.
License
This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.