So i have two problems with getting paypal transaction summary with YQL. First if I try put in my sandbox api info into the yql console, i get results ..sometimes. I figured i should not worry about this and perhaps the paypal sandbox api is just a but flaky but surely the real thing will be more reliable.
However i cannot figure out how to get YQL to use the real api url instead of sandbox.
I will be happy if just this is answered.
The second issue is getting it to run in php. If i copy the entire encoded REST query url at the bottom of the console into php and curl it, then it works. (in sandbox mode of course).
However if i try breaking up the query passing it parameters then building the string and wrapping it in urlencode() before curling. I get null.
Here is what the code to build the string looks like.
$yql_base_url = " https://query.yahooapis.com/v1/public/yql ";
$yql_query = "SELECT * from paypal.transactions"
." WHERE APIUsername=$username"
." AND APIPassword=$password"
." AND Signature=$signature"
." AND StartDate='2012-01-00T00:00:00'";
$yql_query_url = $yql_base_url . "?q=" . $yql_query;
$yql_query_url .= "&diagnostics=true&env=store://datatables.org/alltableswithkeys";
$yql_query_url .= "&format=json";
$yql_query_url = urlencode($yql_query_url);
This fails with or without the urlencode()
first thing – here is the corrected code – basically you have spaces in your base url and instead of urlencoding the parameters, you are url encoding the whole url.
now to answer your other questions:
– yes PayPal sandbox is slow unfortunately, we should’ve added longer timeouts in the table.
– the reason why only sandbox is supported currently is because we released it to see the interest. If you are interested in a table (or a config to say which env you want to use), we can release an updated table.
thanks for trying this out btw and do let us know how we can improve it to make it more useful. Btw here is the source of the paypal transaction tables in case if you want to refer to it or modify it: https://github.com/paypalx/yql-tables/tree/master/paypal