OK .. cant sleep .. got an idea and testet it .. it works .. not at the best but a beginning .. ok what have i done ..
i took this part of script
require_once("functions.php");
$sToken = json_decode(GetAuthToken());
if(isset($_POST['addyBalance'])){
$addyBalance = $_POST['addyBalance'];
if(empty($addyBalance)) {
echo "No Address Entered";
die();
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://v2.api.xapo.com/addresses/" . $addyBalance);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: Bearer " . $sToken->access_token
));
$response = curl_exec($ch);
and change the word "addyBalance" into username and "$addyBalance" into $username
this Code i put into the main index.php (not the style one) after the if($response->success){ line ...
if($response->success){
//EDIT
require_once("check/functions.php");
$sToken = json_decode(GetAuthToken());
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://v2.api.xapo.com/addresses/" . $username);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: Bearer " . $sToken->access_token
));
$response = curl_exec($ch);
//EDITEND
Then i open the Style index.php and puted in
$jsonresponse = json_decode($response);
echo 'Your current balance = ' . $jsonresponse->accrued_balance . ' Cashout at = ' . $jsonresponse->payment_threshold;
?>
OK now when i as non Xapo user Claim with the BTC Address i can see my Balance .. but now come the ugly part .. if i reload the browser its dissapears ... and i have to wait for the next claim .. maybe there is a smarter solution ?