Author

Topic: Probleme withdraw blockchain api PHP (Read 859 times)

legendary
Activity: 3682
Merit: 1580
January 25, 2014, 04:48:01 PM
#2
What does var_dump($op) give you?
newbie
Activity: 13
Merit: 0
January 25, 2014, 07:50:31 AM
#1
Hello all

I have big probléme with withdraw systeme, for déposit its ok i use this https://blockchain.info/fr/api/blockchain_wallet_api
i'am new in blockchain

Code:
$montant = $_POST['wiSold'];
$addr = $_POST['wiAddr'];

// BTC TO SATOSHI
$amount = ($montant * 100000000);

// BLOCKCHAIN LOGIN
$guid = "xxxxx";
$main_password = "xxxx";

// TO
$address = $addr;
$note = "Withdraw";
$shared = "false";

// SUBMIT
$op = "https://blockchain.info/fr/merchant/$guid/payment?password=$main_password&to=$address&amount=$amount&shared=$shared";

$op= file_get_contents($op);
$op = json_decode($op);

// OK
if(empty($op->error))
{
$re = mysql_query("SELECT * FROM account WHERE id_account='".$id_playerSession."' ORDER BY id ASC LIMIT 1");
$do = mysql_fetch_array($re);

$sold_last = $do['sold'];
$sold_new = $sold_last - $montant;
$type = "withdraw";
$id_type = "";
$gain = "-".$montant;
$info = $op->tx_hash;

newTransaction(newHashMd5(), $id_playerSession, $sold_last, $sold_new, $type, $id_type, $gain, $info);

// MESSAGE
$messageTxt = "ID: ".$op->tx_hash." | ".$op->message;
$messageColor = $messageColorGreen;

// SON
$loadSound = "buy";
}
else // ERROR
{
// MESSAGE
$messageTxt = "Error: ".$op->error;
$messageColor = $messageColorRed;

// SON
$loadSound = "error";
}

But the btc no comme to my wallet  Huh  Its probleme with blockchain or in my code
Thanks you
Jump to: