Bitcoin Forum
May 05, 2024, 08:12:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: instawallet api functionality problem, plz help!  (Read 1022 times)
drknow012 (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


Fairy Tale + Fact = Unregulated Virtual Currency!


View Profile WWW
May 08, 2012, 04:39:04 AM
 #1

i'm using instawallet.org's api using php, and all the other stuff works. creating wallets, getting address from wallet id, and checking wallet balance... but sending payment has not gone too well. here's the script i use to send payments using the api:

Quote
$wallet = $tmpLabelData['labelID'];
$address = $_POST['addr'];
$ammount = "0.01";

$url = "https://www.instawallet.org/api/v1/w/$wallet/payment";
$postdata=array('address'=>$address,'amount'=>$amount);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.23 (Windows NT 5.1; U; en)');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$result = curl_exec($ch);
exec('echo  "'.$result.'" > send_btc');

and here's the log for the error that occurs
Quote
{"successful":false,"message":"Sorry, this does not look like a valid Bitcoin address.","message_code":4}

help preez Sad

BTCChess Affiliate Program: Earn 50% on all commissions from referrals at btcchess.tk

Just sign up, post your affiliate link in your sig, and take part in the community's discussions! It's that easy!

Donations and Investors: 1F6yYdQ7rWVaH9Nqv7gbBw5FbZUuhL9smh
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
kangasbros
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1006



View Profile
May 08, 2012, 06:00:41 AM
 #2

The bitcoin address fails to validate, double-check it.

davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


1davout


View Profile WWW
May 08, 2012, 07:47:53 AM
 #3

Your address failed to validate against the Bitcoin client.

Also your amount is wrong, it must be an integer value expressed in Satoshis. If you want to send 0.01 BTC you must send 0.01 * 10^8 (1000000).

drknow012 (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


Fairy Tale + Fact = Unregulated Virtual Currency!


View Profile WWW
May 08, 2012, 02:33:15 PM
 #4

i don't know how i did it, but it works now. i guess there was a space in the address input form that i didn't know about. Roll Eyes

BTCChess Affiliate Program: Earn 50% on all commissions from referrals at btcchess.tk

Just sign up, post your affiliate link in your sig, and take part in the community's discussions! It's that easy!

Donations and Investors: 1F6yYdQ7rWVaH9Nqv7gbBw5FbZUuhL9smh
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!