Jump to content

API issue.... -bitinstant.com-


sprintlife

Recommended Posts

I haven't post here in sometime, but I'm having issue.  I cant get ahold of the people that made this API so I figure I would give you guys a go.

 

I keep getting error when running this code.  Error message is ( Exception raised in parsing - too many parameters - not even bothering to parse ).

 

<!DOCTYPE HTML>
<html>
<head>
<title></title>
</head>
<body>
<?php                                                                   

$data_string = "{\"quote_id\":\"09b1de5a-090d-45bc-87b1-e11f44570b3c\",\"URL\":\"http://test.com/test.php\",\"Secret\":\"15b1370f-4130-4123-a3ab-bce5e174d9cd\"}";                                                                                
   
 
$ch = curl_init('https://www.bitinstant.com/api/json/SetOrderIPN');                                                                      
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
    'Content-Type: application/json',                                                                                
    'Content-Length: ' . strlen($data_string))                                                                       
);                                                                                                                   
 
$result = curl_exec($ch);
echo $result;
?>
</body>
</html>

 

I'm trying to run an API on the SetOrderIPN on ( https://www.bitinstant.com/api ).  This is the information they have on it. 

 

 

 

SetOrderIPN

SetOrderIPN(QuoteID,URL,Secret) - Sends an IPN (Instant Payment Notification) to the specified URL when the order completes

Idempotency

Not idempotent
This method is not idempotent, the data returned is highly likely to change

Parameters

URL
The URL to receive the IPN at

Secret
The secret that will be used to build the SHA-512 HMAC

QuoteID
The QuoteID you want to receive an IPN for

Return values

URL
Repeat of the URL

eventtype
"IPN configured"

Secret
Repeat of the secret

QuoteID
Repeat of the QuoteID

 

 

I was wondering if anyone could point out what I am doing wrong.  :-(

 

I got the source code from this location ( https://bitcointalk.org/index.php?topic=117740.msg1526313#msg1526313 ), but their were using it to place quote (  GetQuote ).

Link to comment
Share on other sites

If you are using PHP 5.2.0 or above, try changing this:

 

$data_string = "{\"quote_id\":\"09b1de5a-090d-45bc-87b1-e11f44570b3c\",\"URL\":\"http://test.com/test.php\",\"Secret\":\"15b1370f-4130-4123-a3ab-bce5e174d9cd\"}";


To this:

$data = new StdClass;
$data->quote_id = "09b1de5a-090d-45bc-87b1-e11f44570b3c";
$data->URL = "http://test.com/test.php";
$data->Secret = "15b1370f-4130-4123-a3ab-bce5e174d9cd";
$data_string = json_encode($data);

 

It may be a problem with your json encoding in your data string. This will let PHP handle the JSON encoding, so it may solve your problem.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.