PHP code example of bogiesoft / qr-payment

1. Go to this page and download the library: Download bogiesoft/qr-payment library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bogiesoft / qr-payment example snippets


# To generate PromptPay QR Code
$promptpay = new bogiesoft\PromptPay();

// Grab parameter from URI
// ?amount=99.25&targer=0810993011
$amount = $_GET['amount'] ?? 99.99;
$target = $_GET['target'] ?? '0810993011';

// Display qrcode as PNG image
$promptpay->generateQrCode($target, $amount);


# To generate SCB QR-Payment
$scb = new bogiesoft\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);