Ah yes, I did notice that the JSON that was returned was missing some commas, and json_decode() was returning null, so I was able to deal with that.
I got an access token from all that, and then tried to go to what I want to do, download some order information.
I put together the following code to do this, but I get
Error: access_denied, client and server signatures do not match
- Code: Select all
$download_nonce = "503bb763";
$access_token = $auth_vals["access_token"];
$order_url = $auth_vals["download_url"];
$order_message = "clientApp=1&dbname=orders&version=11.0";
$order_message .= "&token=" . $access_token;
$order_message .= "×tamp=" . time();
$order_message .= "&nonce=" . $download_nonce;
$order_message .= "&pay=no_cvv";
$order_string = $order_url . "?" . $order_message;
$order_hash = hash_hmac('sha1', $order_string, $secret_key, true);
$download_sig = base64_encode($order_hash);
$order_message .= "&signature=" . $download_sig;
I'm not positive about what to put for the version number. Apparently we have version 11 r1.2. So would should I put in the field there?
Then there's the part about creating the signature. I'm obviously doing something wrong. The help page says
signature for download request (request URL and query string, signed with secret key, then base64 encoded)
I'm combining the request URL and query string with a "?" in between, but I'm not sure what else it needs.