{"action":"created","issue":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/394","labels_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/394/labels{/name}","comments_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/394/comments","events_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/394/events","html_url":"https://github.com/paypal/PayPal-PHP-SDK/issues/394","id":106031539,"number":394,"title":"response code 401 when retrieve payment details ","user":{"login":"momopaper","id":6683119,"avatar_url":"https://avatars.githubusercontent.com/u/6683119?v=3","gravatar_id":"","url":"https://api.github.com/users/momopaper","html_url":"https://github.com/momopaper","followers_url":"https://api.github.com/users/momopaper/followers","following_url":"https://api.github.com/users/momopaper/following{/other_user}","gists_url":"https://api.github.com/users/momopaper/gists{/gist_id}","starred_url":"https://api.github.com/users/momopaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/momopaper/subscriptions","organizations_url":"https://api.github.com/users/momopaper/orgs","repos_url":"https://api.github.com/users/momopaper/repos","events_url":"https://api.github.com/users/momopaper/events{/privacy}","received_events_url":"https://api.github.com/users/momopaper/received_events","type":"User","site_admin":false},"labels":[{"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":2,"created_at":"2015-09-11T15:20:23Z","updated_at":"2015-09-11T15:48:50Z","closed_at":"2015-09-11T15:43:37Z","body":"i wastrying to retrieve a payment details by payment id received from a created transaction but i got the following response:\r\nGot Http response code 401 when accessing https://api.sandbox.paypal.com/v1/payments/payment/PAY-xxxxxxxxxxxxxxxxxxxxxxxxxxx.\r\n\r\nHere are my code: \r\n\r\n        $this->apiContext = new \\PayPal\\Rest\\ApiContext(\r\n                new \\PayPal\\Auth\\OAuthTokenCredential(\r\n                'xxxxxxxx', // ClientID\r\n                'xxxxxxxx'      // ClientSecret\r\n                )\r\n        );\r\n        $tokenInfo = new OpenIdTokeninfo();\r\n        $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $this->apiContext);\r\n        $cred = \"Bearer \" . $tokenInfo->getAccessToken();\r\n        $this->apiContext->addRequestHeader(\"Authorization\", $cred);\r\n        $payment = Payment::get($paymentId, $this->apiContext);\r\n\r\n\r\nis there anything wrong with my codes?"},"comment":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/comments/139581865","html_url":"https://github.com/paypal/PayPal-PHP-SDK/issues/394#issuecomment-139581865","issue_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/394","id":139581865,"user":{"login":"momopaper","id":6683119,"avatar_url":"https://avatars.githubusercontent.com/u/6683119?v=3","gravatar_id":"","url":"https://api.github.com/users/momopaper","html_url":"https://github.com/momopaper","followers_url":"https://api.github.com/users/momopaper/followers","following_url":"https://api.github.com/users/momopaper/following{/other_user}","gists_url":"https://api.github.com/users/momopaper/gists{/gist_id}","starred_url":"https://api.github.com/users/momopaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/momopaper/subscriptions","organizations_url":"https://api.github.com/users/momopaper/orgs","repos_url":"https://api.github.com/users/momopaper/repos","events_url":"https://api.github.com/users/momopaper/events{/privacy}","received_events_url":"https://api.github.com/users/momopaper/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T15:48:50Z","updated_at":"2015-09-11T15:48:50Z","body":"Yes, im doing future payment "}}