Skip to content

MrTheBank/truewallet-gift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

composer require mrthebank/truewallet

Usage

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'];
}

If you want to see full response then do

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>'

Reference

https://github.com/Mixzis/truewalletgift-php/blob/main/rb_tw.class.php

License

The MIT License (MIT)

About

PHP Package - TrueWallet Gift Code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages