PHP generate PrompPay QR Code for pay on Thailand Banking application
get library QR Generator
- run
composer install
<?php
include_once("vendor/autoload.php");
use ThaiPromptpay\PromptpayQR;
$qr = new PromptpayQR;
$qr->setPromptpayType('02');
$qr->setPromptpayID('4419928285542');
$qr->setAmount(200.50);
echo $qr->getQR();
?>
set type of Promptpay ID
- 01 = Mobile Number
- 02 = Citizen ID
set Promptpay ID
- for Citizen ID, Using full length of Citizen (13 Characters) and only number such as
1234567890123
- for Mobile ID, Start with "00" and Number of Country Code "66" and Mobile Phone Number exclude zero prefixes such as
0066831234567
set amount of money for pay
- if have amount, Using digit and 2 decimals such as
199.50
- if not want to amount, Using
0
Display QR Image
Display raw text of your pay code (this code use for generating to QR Code)