01.
<?php
02.
include
(
'TMNWallet.php'
);
03.
$GLOBALS
[
"Email"
]=
"XXX@hotmail.com"
;
04.
$GLOBALS
[
"password"
]=
"XXX"
;
05.
$GLOBALS
[
"truemoney"
]=
new
TMNWallet(
$GLOBALS
[
"Email"
],
$GLOBALS
[
"password"
],
"email"
);
06.
$GLOBALS
[
"token"
]=
""
;
07.
$GLOBALS
[
"amount"
]=
"0"
;
08.
09.
function
login_truemoney(){
10.
$decode
= json_decode(
$GLOBALS
[
"truemoney"
]->GetToken(),true);
11.
$id
=
$decode
[
"data"
][
"accessToken"
];
12.
$GLOBALS
[
"token"
]=
$id
;
13.
}
14.
15.
function
Refill(
$id
){
16.
$result
=
$check
=json_decode(
$GLOBALS
[
"truemoney"
]->Topup(
$id
,
$GLOBALS
[
"token"
]),true);
17.
if
(isset(
$result
[
"cashcardPin"
])){
18.
$GLOBALS
[
"amount"
]=
$result
[
"amount"
];
19.
return
1;
20.
}
else
{
21.
return
0;
22.
}
23.
}
24.
25.
function
PriceAmount(){
26.
return
$GLOBALS
[
"amount"
];
27.
}
28.
?>