{"action":"created","issue":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/296","labels_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/296/comments","events_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/296/events","html_url":"https://github.com/paypal/PayPal-PHP-SDK/issues/296","id":71278919,"number":296,"title":"Unable to retrieve payment list","user":{"login":"stormsson","id":1133032,"avatar_url":"https://avatars.githubusercontent.com/u/1133032?v=3","gravatar_id":"","url":"https://api.github.com/users/stormsson","html_url":"https://github.com/stormsson","followers_url":"https://api.github.com/users/stormsson/followers","following_url":"https://api.github.com/users/stormsson/following{/other_user}","gists_url":"https://api.github.com/users/stormsson/gists{/gist_id}","starred_url":"https://api.github.com/users/stormsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormsson/subscriptions","organizations_url":"https://api.github.com/users/stormsson/orgs","repos_url":"https://api.github.com/users/stormsson/repos","events_url":"https://api.github.com/users/stormsson/events{/privacy}","received_events_url":"https://api.github.com/users/stormsson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/labels/api-payments","name":"api-payments","color":"207de5"},{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/labels/question","name":"question","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-27T13:10:39Z","updated_at":"2015-04-28T21:20:36Z","closed_at":"2015-04-27T21:09:14Z","body":"I have a sandbox account with 2 payments. \r\ntrying to retrieve the payment list, always returns an empty array\r\n```php\r\n            $params = array('count' => 10, 'start_index' => 0);   \r\n            $args['payments'] = Payment::all($params, $apiContext);\r\n```\r\nthis returns:\r\n\r\n```php\r\nobject(PayPal\\Api\\PaymentHistory)[122]\r\n  private '_propMap' (PayPal\\Common\\PayPalModel) => \r\n    array (size=0)\r\n      empty\r\n```\r\n\r\nthe context is created as follows:\r\n```php\r\n    protected function createPaypalApiContext($app)\r\n    {\r\n        $configs = array(\r\n            'mode' => 'sandbox',\r\n            'http.ConnectionTimeOut' => 30,\r\n            'log.LogEnabled' => true,\r\n            'log.FileName' => $app['log_dir'].'/paypal.log',\r\n            'log.LogLevel' => 'FINE',\r\n            'validation.level' => 'log'\r\n        );\r\n\r\n        $this->apiContext = new ApiContext(\r\n            new OAuthTokenCredential(\r\n                $app['paypal']['client_id'],     // ClientID\r\n                $app['paypal']['client_secret']      // ClientSecret\r\n            )\r\n        );\r\n\r\n        $this->apiContext->setConfig($configs);\r\n\r\n        return $this->apiContext;\r\n    }\r\n```\r\n\r\nis this a bug ?"},"comment":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/comments/97210643","html_url":"https://github.com/paypal/PayPal-PHP-SDK/issues/296#issuecomment-97210643","issue_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/296","id":97210643,"user":{"login":"stormsson","id":1133032,"avatar_url":"https://avatars.githubusercontent.com/u/1133032?v=3","gravatar_id":"","url":"https://api.github.com/users/stormsson","html_url":"https://github.com/stormsson","followers_url":"https://api.github.com/users/stormsson/followers","following_url":"https://api.github.com/users/stormsson/following{/other_user}","gists_url":"https://api.github.com/users/stormsson/gists{/gist_id}","starred_url":"https://api.github.com/users/stormsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormsson/subscriptions","organizations_url":"https://api.github.com/users/stormsson/orgs","repos_url":"https://api.github.com/users/stormsson/repos","events_url":"https://api.github.com/users/stormsson/events{/privacy}","received_events_url":"https://api.github.com/users/stormsson/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T21:20:36Z","updated_at":"2015-04-28T21:20:36Z","body":"Hi, first of all, thank you for your help, secondly i'd like to share the workaround i am using for the moment, because others may have a similar problem:\r\n\r\nTL;DR: \r\ni used the js button and the PDT data :(\r\n\r\nLong version / why other solutions didn't work:\r\n\r\nThe objective: receive donations +  track how many payments are done per donator at different times of the month. \r\n\r\n**Idea 1: JS Button + Rest APIS**\r\nuse the REST apis to periodically  retrieve the payments and then elaborate the data.\r\nSince the payments are not done via the apis this doesn't work\r\n\r\n** Idea 2: Manually create the payment (via the rest api)**\r\ncreate the payment and the payment url via the rest apis and then redirect the user, \r\n2 main problems occurred:\r\n1) it doesnt seem to work like a donation, just a sale\r\n2) the paypal landing page is different: when you click the traditional JS button, the landing page has both the login form and a credit card compilation form, so users who have not a paypal account may stil donate. \r\nThe landing page of the generated payment has only the login form.\r\nThis would disincentivate many users to donate. \r\nThe alternative would be to handle the credit card data in our site,this was not a viable solution. \r\nso, even this is  discarded\r\n\r\n** Idea 3: the classic apis**\r\nTo use the classic api you need a \"classic app\": it seems that you have to compile a very complex application form:\r\n![immagine](https://cloud.githubusercontent.com/assets/1133032/7380455/3e02db04-edfc-11e4-85e6-6c840d8acea1.png)\r\n\r\nFrankly, i have no idea how i should compile that for my customer, therefore even this solution was discarded.\r\nAlso, this doesn't seem to have a sandbox. \r\n\r\nThe solution:\r\nPDT.\r\nhttps://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/paymentdatatransfer/\r\n\r\n:/\r\n"}}