farzai / promptpay
PromptPay QR Code Generator
Fund package maintenance!
parsilver
Requires
- php: ^8.1
- endroid/qr-code: ^4.8
- nyholm/psr7: ^1.8
- psr/http-message: ^1.0|^2.0
- symfony/console: ^6.2
Requires (Dev)
- laravel/pint: ^1.2
- pestphp/pest: ^1.20
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/ray: ^1.28
This package is auto-updated.
Last update: 2024-04-15 13:28:37 UTC
README
This library that allows you to create PromptPay QR codes. You can generate a QR code for receiving payments through PromptPay, which is a popular payment method in Thailand.
Requirements
- PHP 8.0 or higher
Installation (For CLI)
You can install the package globally via composer:
composer global require farzai/promptpay
Make sure to place Composer's system-wide vendor bin directory in your $PATH so the promptpay executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:
For macOS
$HOME/.composer/vendor/bin
For GNU / Linux Distributions
GNU / Linux Distributions: $HOME/.config/composer/vendor/bin
For Windows
%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
Usage
promptpay 0988888888 --amount 100
Installation (For PHP Application)
You can install the package via composer:
composer require farzai/promptpay
Usage
use Farzai\PromptPay\Generator; $generator = new Generator(); $qrCode = $generator->generate( target: "098-888-8888", amount: 100 ); // Next, you can save the image to a file: $qrCode->save('qrcode.png'); // Or insert it directly into a template: echo '<img src="' . $qrCode->asDataUri() . '" />';
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.