Author

Topic: API call 'sendfrom' not working (Read 1637 times)

newbie
Activity: 28
Merit: 0
March 04, 2014, 05:58:51 PM
#4
I make a 'getbalance' call to  be sure that there are enough funds, it works. Then i use 'sendfrom' to send from an account to an address and it just does not work:

$btc = "0.01000000";

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

it just returns null, so i have no idea what the error is.

I'm using the testnet.

Make sure $btc is a numeric value rather than a string, in php;

Code:
$btc = floatval("0.01000000");

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

Your confirmation number may also need to be an int (e.g. intval("6") )
full member
Activity: 238
Merit: 105
March 04, 2014, 01:25:03 PM
#3
Well, i tested not using variables for the params. Instead i hardcoded the parameters and it worked. Why it would not work with variables? I've checked and the var values are all correct.


Open up wireshark, compare the difference?
sr. member
Activity: 364
Merit: 257
March 04, 2014, 03:34:23 AM
#2
Well, i tested not using variables for the params. Instead i hardcoded the parameters and it worked. Why it would not work with variables? I've checked and the var values are all correct.
sr. member
Activity: 364
Merit: 257
March 04, 2014, 01:27:35 AM
#1
I make a 'getbalance' call to  be sure that there are enough funds, it works. Then i use 'sendfrom' to send from an account to an address and it just does not work:

$btc = "0.01000000";

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

it just returns null, so i have no idea what the error is.

I'm using the testnet.
Jump to: