PHP code example of khqr-gateway / bakong-khqr-php
1. Go to this page and download the library: Download khqr-gateway/bakong-khqr-php 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/ */
khqr-gateway / bakong-khqr-php example snippets
use KHQR\BakongKHQR;
use KHQR\Helpers\KHQRData;
use KHQR\Models\IndividualInfo;
$individualInfo = new IndividualInfo(
bakongAccountID: 'jonhsmith@nbcq',
merchantName: 'Jonh Smith',
merchantCity: 'PHNOM PENH',
currency: KHQRData::CURRENCY_KHR,
amount: 500
);
var_dump(BakongKHQR::generateIndividual($individualInfo));
use KHQR\BakongKHQR;
use KHQR\Models\MerchantInfo;
$merchantInfo = new MerchantInfo(
bakongAccountID: 'jonhsmith@nbcq',
merchantName: 'Jonh Smith',
merchantCity: 'Siem Reap',
merchantID: '123456',
acquiringBank: 'Dev Bank',
mobileNumber: '85512345678',
);
var_dump(BakongKHQR::generateMerchant($merchantInfo));