|
Navles
Newbie
Offline
Activity: 9
Merit: 0
|
|
May 22, 2013, 07:40:08 PM |
|
Hello,
Do you have OTP enabled for your account?
-Navles
|
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 22, 2013, 08:03:22 PM |
|
I just entered the data. and still returned a blank page.
tinkering
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 22, 2013, 08:07:50 PM |
|
actually adding data. breaks the get account info as well const api_url = ' https://data.mtgox.com/api/'; FAILD const api_url = ' https://mtgox.com/api/'; returns only on the get account into, not send simple might this have something to do with the https?
|
|
|
|
Navles
Newbie
Offline
Activity: 9
Merit: 0
|
|
May 22, 2013, 08:43:52 PM |
|
M... weird.
I'm setting up a test environment as we speak.
I will get back to you in a second.
-Navles
|
|
|
|
Navles
Newbie
Offline
Activity: 9
Merit: 0
|
|
May 22, 2013, 09:11:54 PM |
|
I wrote some test code and got the following exception:
"Parameter amount_int or amount is required" - Which is the default exception if something is wrong. Currently i have no BTC in my account, so i suspect that's why i get this error. Can you please try with the following code?
START CODE <?php include 'mtgox_api_base.php'; include 'mtgox_private_api.php';
$private = new MtGox_Private_Api(); $private->set_currency('EUR'); // CHANGE TO USD IF YOU NEED USD!! $private->set_authentication("KEY", "SECRET"); try{ $send_simple = $private->withdraw_coins("BTC ADDRESS", "AMOUNT (eg. 0)"); print_r($send_simple); }catch(Exception $e) { print_r($e); }
?> END CODE
Please let me know if this works.
-Navles
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 22, 2013, 10:53:41 PM |
|
used your script and getting the following error as well. ( i do have btc in the account.) Exception Object ( [message:protected] => Parameter amount_int or amount is required [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/admin/atm/mtgox_api_base.php [line:protected] => 79 [trace:Exception:private] => Array ( - => Array ( [file] => /var/www/admin/atm/mtgox_api_base.php [line] => 70 [function] => process_api_response [class] => MtGox_Api_Base [type] => -> [args] => Array (
- => Array ( [result] => error [error] => Parameter amount_int or amount is required [token] => unknown_error ) ) ) [1] => Array ( [file] => /var/www/admin/atm/mtgox_private_api.php [line] => 46 [function] => send_request [class] => MtGox_Api_Base [type] => -> [args] => Array (
- => 1/generic/bitcoin/send_simple ) ) [2] => Array ( [file] => /var/www/admin/atm/history.php [line] => 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array (
- => 14XnxAbrNZkkXRX76MS2S5JnJ1hUbgCs1Y [1] => 1 ) ) ) [previous:Exception:private] => )
post an address and I can send some btc for testing.
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 22, 2013, 11:04:19 PM |
|
if I use https://data.mtgox.com/api/I get the following error; Exception Object ( [message:protected] => Could not get reply: Unknown SSL protocol error in connection to data.mtgox.com:443 [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/admin/atm/mtgox_api_base.php [line:protected] => 111 [trace:Exception:private] => Array ( - => Array ( [file] => /var/www/admin/atm/mtgox_api_base.php [line] => 69 [function] => post_api_request [class] => MtGox_Api_Base [type] => -> [args] => Array (
- => 1/generic/bitcoin/send_simple [1] => Array ( ) ) ) [1] => Array ( [file] => /var/www/admin/atm/mtgox_private_api.php [line] => 46 [function] => send_request [class] => MtGox_Api_Base [type] => -> [args] => Array (
- => 1/generic/bitcoin/send_simple ) ) [2] => Array ( [file] => /var/www/admin/atm/history.php [line] => 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array (
- => 14XnxAbrNZkkXRX76MS2S5JnJ1hUbgCs1Y [1] => 1 ) ) ) [previous:Exception:private] => )
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 23, 2013, 02:29:44 AM |
|
*bumb added bounty
|
|
|
|
BCB
CTG
VIP
Legendary
Offline
Activity: 1078
Merit: 1002
BCJ
|
|
May 23, 2013, 02:31:50 AM |
|
how much is the bounty
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 23, 2013, 02:36:20 AM |
|
.1btc my script <?php include 'mtgox_api_base.php'; include 'mtgox_private_api.php';
$private = new MtGox_Private_Api(); $private->set_currency('USD'); // CHANGE TO USD IF YOU NEED USD!! $private->set_authentication("SSSSSSSSSSSSSSSS", "SSSSSSSSSSSSSSSSSSSSSSS");
$address = '14XnxAbrNZkkXRX76MS2S5JnJ1hUbgCs1Y'; $amount_int = 10000;
try{ $send_simple = $private->withdraw_coins($amount_int, $address); print_r($send_simple); }catch(Exception $e) { print_r($e); } ?>
is returning the error Exception Object ( [message:protected] => Parameter amount_int or amount is required [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/admin/atm/mtgox_api_base.php [line:protected] => 79 [trace:Exception:private] => Array ( - => Array ( [file] => /var/www/admin/atm/mtgox_api_base.php [line] => 70 [function] => process_api_response [class] => MtGox_Api_Base [type] => -> [args] => Array (
- => Array ( [result] => error [error] => Parameter amount_int or amount is required [token] => unknown_error ) ) ) [1] => Array ( [file] => /var/www/admin/atm/mtgox_private_api.php [line] => 46 [function] => send_request [class] => MtGox_Api_Base [type] => -> [args] => Array (
- => 1/generic/bitcoin/send_simple ) ) [2] => Array ( [file] => /var/www/admin/atm/history.php [line] => 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array (
- => 10000 [1] => 14XnxAbrNZkkXRX76MS2S5JnJ1hUbgCs1Y ) ) ) [previous:Exception:private] => )
|
|
|
|
BCB
CTG
VIP
Legendary
Offline
Activity: 1078
Merit: 1002
BCJ
|
|
May 23, 2013, 02:45:48 AM |
|
do you have otp enabled
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 23, 2013, 03:54:36 AM |
|
I do not have any 2 factor enabled;
and the key does have withdraw enabled.
|
|
|
|
matt4054
Legendary
Offline
Activity: 1946
Merit: 1035
|
|
May 23, 2013, 04:03:30 AM |
|
According to the source on github, you are calling withdraw_coins() with arguments in the wrong orders. Here's code from the API: <?php // Send bitcoins from your account to a bitcoin address. public function withdraw_coins($address, $amount_int, $fee_int=null, $no_instant=null, $green=null) { return $this->send_request(self::uri_withdraw_coins); } ?>
You should try swapping $address and $amount_int: <?php try { $send_simple = $private->withdraw_coins($address, $amount_int); print_r($send_simple); } catch(Exception $e) { print_r($e); } ?>
If that solves your problem, tips appreciated ;-) BTC: 13otqU1gvatwws9euEZczTXiBWhvcHUrGq Cheers, Matt
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 23, 2013, 05:45:40 AM |
|
corrected order, still getting same error :/ noticed the end of the error changed when I switched them backwards 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array ( - => 1 [1] => 14XnxAbrNZkkXRX76MS2S5JnJ1hUbgCs1Y ) ) ) [previous:Exception:private] => )
correct 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array ( - => 14XnxAbrNZkkXRX76MS2S5JnJ1hUbgCs1Y [1] => 1 ) ) ) [previous:Exception:private] => )
but other then that the error is the same. (sent you a little bit for taking the time to look)
|
|
|
|
matt4054
Legendary
Offline
Activity: 1946
Merit: 1035
|
|
May 23, 2013, 06:11:01 AM |
|
corrected order, still getting same error :/ noticed the end of the error changed when I switched them backwards 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array ( - => 1 [1] => 14XnxAbrNZkkXRX76MS2S5JnJ1hUbgCs1Y ) ) ) [previous:Exception:private] => )
correct 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array ( - => 14XnxAbrNZkkXRX76MS2S5JnJ1hUbgCs1Y [1] => 1 ) ) ) [previous:Exception:private] => )
but other then that the error is the same. (sent you a little bit for taking the time to look) Thanks. I looked further into the API, I don't understand how it could work. Try changing withdraw_coins() in mtgox_private_api.php this way: <?php // Send bitcoins from your account to a bitcoin address. public function withdraw_coins($address, $amount_int, $fee_int=null, $no_instant=null, $green=null) { $params = array( 'address' => $address, 'amount_int' => $amount_int ); return $this->send_request(self::uri_withdraw_coins, $params); } ?>
It's a quick hack out of my imagination. Tell me if it works or not, if I have time I will look further into it.
|
|
|
|
BitvoinVender (OP)
Newbie
Offline
Activity: 46
Merit: 0
|
|
May 23, 2013, 05:26:18 PM Last edit: May 23, 2013, 06:37:28 PM by BitvoinVender |
|
Thank you very much Matt,
That quick hack was indeed correct
|
|
|
|
matt4054
Legendary
Offline
Activity: 1946
Merit: 1035
|
|
May 23, 2013, 07:00:13 PM |
|
Thank you so much for your very generous donation. It is very much appreciated, I take it as an incentive to further help you and others with coding issues involving the Gox API and PHP (had to go through this myself, with my own implementation of the JSON RPC API though).
Cheers,
Matt
|
|
|
|
|