{"action":"created","issue":{"url":"https://api.github.com/repos/robmcvey/cakephp-paypal/issues/42","labels_url":"https://api.github.com/repos/robmcvey/cakephp-paypal/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/robmcvey/cakephp-paypal/issues/42/comments","events_url":"https://api.github.com/repos/robmcvey/cakephp-paypal/issues/42/events","html_url":"https://github.com/robmcvey/cakephp-paypal/issues/42","id":114864880,"number":42,"title":"storeCreditCard Response","user":{"login":"kriskd","id":193937,"avatar_url":"https://avatars.githubusercontent.com/u/193937?v=3","gravatar_id":"","url":"https://api.github.com/users/kriskd","html_url":"https://github.com/kriskd","followers_url":"https://api.github.com/users/kriskd/followers","following_url":"https://api.github.com/users/kriskd/following{/other_user}","gists_url":"https://api.github.com/users/kriskd/gists{/gist_id}","starred_url":"https://api.github.com/users/kriskd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kriskd/subscriptions","organizations_url":"https://api.github.com/users/kriskd/orgs","repos_url":"https://api.github.com/users/kriskd/repos","events_url":"https://api.github.com/users/kriskd/events{/privacy}","received_events_url":"https://api.github.com/users/kriskd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-03T17:16:29Z","updated_at":"2015-11-05T09:31:08Z","closed_at":"2015-11-05T09:31:08Z","body":"The `responseArray` for the `storeCreditCard` method looks for a `code` key, which doesn't appear to exist according to the API documentation: https://developer.paypal.com/docs/integration/direct/rest-vault-overview/#store-a-credit-card.  Rather should the check be for an `id` or perhaps a value for `state` although I'm unsure what the other values besides \"ok\" might be.  Also, the URL reference to the Paypal API is incorrect.\r\n\r\nLet me know if you agree and I can submit a PR."},"comment":{"url":"https://api.github.com/repos/robmcvey/cakephp-paypal/issues/comments/154003464","html_url":"https://github.com/robmcvey/cakephp-paypal/issues/42#issuecomment-154003464","issue_url":"https://api.github.com/repos/robmcvey/cakephp-paypal/issues/42","id":154003464,"user":{"login":"robmcvey","id":222958,"avatar_url":"https://avatars.githubusercontent.com/u/222958?v=3","gravatar_id":"","url":"https://api.github.com/users/robmcvey","html_url":"https://github.com/robmcvey","followers_url":"https://api.github.com/users/robmcvey/followers","following_url":"https://api.github.com/users/robmcvey/following{/other_user}","gists_url":"https://api.github.com/users/robmcvey/gists{/gist_id}","starred_url":"https://api.github.com/users/robmcvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robmcvey/subscriptions","organizations_url":"https://api.github.com/users/robmcvey/orgs","repos_url":"https://api.github.com/users/robmcvey/repos","events_url":"https://api.github.com/users/robmcvey/events{/privacy}","received_events_url":"https://api.github.com/users/robmcvey/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T09:31:08Z","updated_at":"2015-11-05T09:31:08Z","body":"Hi Kris,\r\n\r\nI think you're referring to [this line](https://github.com/robmcvey/cakephp-paypal/blob/master/Lib/Paypal.php#L689), the `response->code` is the HTTP status code returned from HttpSocket, then as long as we get a HTTP 200 we decode the JSON from PayPal (in `response->body`) and check the `state` key.\r\n\r\nI managed to find the docs for the <b>credit_card object</b> and they read as follows;\r\n\r\n<blockquote><em>string</em> \tState of the credit card funding instrument: `expired` or `ok`.\r\nValue assigned by PayPal</blockquote>\r\n\r\n...so I think we're good to just check for a 200 response, then ensure the state is `ok`, we can then assume the card is stored.\r\n\r\nGood spot on the dead link! I'll update this.\r\n\r\nThank you! :+1: "}}