Bitcoin Forum
July 28, 2024, 02:21:26 AM *
News: Help 1Dq create 15th anniversary forum artwork.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Probleme withdraw blockchain api PHP  (Read 838 times)
pulser (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
January 25, 2014, 12:50:31 PM
 #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: <a href='https://blockchain.info/address/".$op->tx_hash."' target='_blank'>".$op->tx_hash."</a> | ".$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
Abdussamad
Legendary
*
Offline Offline

Activity: 3640
Merit: 1571



View Profile
January 25, 2014, 09:48:01 PM
 #2

What does var_dump($op) give you?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!