PHP code example of mrthebank / truewallet

1. Go to this page and download the library: Download mrthebank/truewallet 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/ */

    

mrthebank / truewallet example snippets


use MrTheBank\TrueWallet\TrueWallet;

$tw = new TrueWallet('YOUR PHONE NUMBER');
$ret = $tw->Redeem('https://gift.truemoney.com/campaign/?v=XXXXXXXXXXXXXXXXXX');

if ($ret['status']['code'] != 'SUCCESS' && $ret['data']['voucher']['member'] == '1') {
    echo $ret['data']['voucher']['amount_baht']; // X.XX
} else {
    echo $ret['status']['message'];
    echo $ret['status']['code'];
}

use MrTheBank\TrueWallet\TrueWallet;

$tw = new TrueWallet('YOUR PHONE NUMBER');
$ret = $tw->Redeem('https://gift.truemoney.com/campaign/?v=XXXXXXXXXXXXXXXXXX');

echo '<pre>';
print_r($ret);
echo '</pre>'