mrthebank / truewallet
PHP Package - TrueWallet Gift Code
1.0
2021-06-21 09:26 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2025-08-24 17:52:50 UTC
README
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)