{"action":"created","issue":{"url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK/issues/258","repository_url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK","labels_url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK/issues/258/comments","events_url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK/issues/258/events","html_url":"https://github.com/paypal/PayPal-Ruby-SDK/issues/258","id":192762410,"number":258,"title":"Payment.find will not return error message which Payment.execute returned","user":{"login":"hkmaly","id":4201080,"avatar_url":"https://avatars0.githubusercontent.com/u/4201080?v=3","gravatar_id":"","url":"https://api.github.com/users/hkmaly","html_url":"https://github.com/hkmaly","followers_url":"https://api.github.com/users/hkmaly/followers","following_url":"https://api.github.com/users/hkmaly/following{/other_user}","gists_url":"https://api.github.com/users/hkmaly/gists{/gist_id}","starred_url":"https://api.github.com/users/hkmaly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkmaly/subscriptions","organizations_url":"https://api.github.com/users/hkmaly/orgs","repos_url":"https://api.github.com/users/hkmaly/repos","events_url":"https://api.github.com/users/hkmaly/events{/privacy}","received_events_url":"https://api.github.com/users/hkmaly/received_events","type":"User","site_admin":false},"labels":[{"id":99059360,"url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK/labels/api-bug","name":"api-bug","color":"fbca04","default":false},{"id":180825479,"url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK/labels/api-docs","name":"api-docs","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-01T06:11:37Z","updated_at":"2017-03-17T23:07:55Z","closed_at":"2017-03-17T23:07:55Z","body":"### General Information\r\n\r\n- Mode (Sandbox/Live): Live\r\n- PayPal-Debug-ID(s) (from any logs): 13a48c8bc07b0\r\n- Version of Ruby used: 1.9.3 (with TLS 1.2 path)\r\n- SDK Version: 1.6.0\r\n\r\n### Issue Description\r\n\r\nWhen Payment::execute returns error like `INSTRUMENT_DECLINED`, you need to capture this error from the same object you called the execute on ; if you refresh it with Payment.find, only sign the payment failed will be the state, there is no detailed error message anywhere.\r\n\r\nObviously, I shouldn't called the Payment.find, that's bug in my code, but it's still surprising behaviour.\r\n\r\n(The complete error response was\r\n```\r\nResponse.body={\"name\":\"INSTRUMENT_DECLINED\",\"details\":[],\"message\":\"The instrument presented  was either declined by the processor or bank, or it can't be used for this payment.\",\"information_link\":\"https://developer.paypal.com/docs/api/#INSTRUMENT_DECLINED\",\"debug_id\":\"13a48c8bc07b0\"}  Response.header={\"date\"=>[\"Wed, 30 Nov 2016 05:00:00 GMT\"], \"server\"=>[\"Apache\"], \"paypal-debug-id\"=>[\"13a48c8bc07b0\", \"13a48c8bc07b0\"], \"content-language\"=>[\"*\"], \"connection\"=>[\"close\", \"close\"], \"http_x_pp_az_locator\"=>[\"dcg11.slc\"], \"set-cookie\"=>[\"X-PPSILOVER=name%3DLIVE3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D3495706200%26HTTP_X_PP_AZ_LOCATOR%3Ddcg11.slc; Expires=Wed, 30 Nov 2016 05:30:02 GMT; domain=.paypal.com; path=/; Secure; HttpOnly\", \"X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\"], \"vary\"=>[\"Authorization\"], \"content-length\"=>[\"272\"], \"content-type\"=>[\"application/json\"]}\r\n```\r\n)\r\n"},"comment":{"url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK/issues/comments/287492746","html_url":"https://github.com/paypal/PayPal-Ruby-SDK/issues/258#issuecomment-287492746","issue_url":"https://api.github.com/repos/paypal/PayPal-Ruby-SDK/issues/258","id":287492746,"user":{"login":"braebot","id":3358986,"avatar_url":"https://avatars2.githubusercontent.com/u/3358986?v=3","gravatar_id":"","url":"https://api.github.com/users/braebot","html_url":"https://github.com/braebot","followers_url":"https://api.github.com/users/braebot/followers","following_url":"https://api.github.com/users/braebot/following{/other_user}","gists_url":"https://api.github.com/users/braebot/gists{/gist_id}","starred_url":"https://api.github.com/users/braebot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/braebot/subscriptions","organizations_url":"https://api.github.com/users/braebot/orgs","repos_url":"https://api.github.com/users/braebot/repos","events_url":"https://api.github.com/users/braebot/events{/privacy}","received_events_url":"https://api.github.com/users/braebot/received_events","type":"User","site_admin":false},"created_at":"2017-03-17T23:07:55Z","updated_at":"2017-03-17T23:07:55Z","body":"This issue is now at https://github.com/paypal/PayPal-REST-API-Issues/issues/39. Follow this new issue to receive updates."}}
{"actor":{"display_login":"braebot"}}