{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/active_merchant/pulls/comments/32658588","id":32658588,"diff_hunk":"@@ -459,6 +460,20 @@ def non_fractional_currency?(currency)\n       def emv_payment?(payment)\n         payment.respond_to?(:emv?) && payment.emv?\n       end\n+\n+      def error_code_from(response)","path":"lib/active_merchant/billing/gateways/stripe.rb","position":22,"original_position":22,"commit_id":"7db96b3e59f8f46c383d98f14eba734f5be33b0b","original_commit_id":"2b41cd3d13a8a3150381fa78f8eb7c4c73968dd3","user":{"login":"bizla","id":4581564,"avatar_url":"https://avatars.githubusercontent.com/u/4581564?v=3","gravatar_id":"","url":"https://api.github.com/users/bizla","html_url":"https://github.com/bizla","followers_url":"https://api.github.com/users/bizla/followers","following_url":"https://api.github.com/users/bizla/following{/other_user}","gists_url":"https://api.github.com/users/bizla/gists{/gist_id}","starred_url":"https://api.github.com/users/bizla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bizla/subscriptions","organizations_url":"https://api.github.com/users/bizla/orgs","repos_url":"https://api.github.com/users/bizla/repos","events_url":"https://api.github.com/users/bizla/events{/privacy}","received_events_url":"https://api.github.com/users/bizla/received_events","type":"User","site_admin":false},"body":"```ruby\r\ncode = response['error']['code'] \r\ndecline_code = response['error']['decline_code'] \r\n\r\nerror_code = if decline_code && code == 'card_declined'\r\n  STANDARD_ERROR_CODE_MAPPING[decline_code] \r\nelse\r\n  STANDARD_ERROR_CODE_MAPPING[code] \r\nend\r\n\r\nerror_code\r\n```","created_at":"2015-06-17T18:28:06Z","updated_at":"2015-06-17T18:28:06Z","html_url":"https://github.com/Shopify/active_merchant/pull/1748#discussion_r32658588","pull_request_url":"https://api.github.com/repos/Shopify/active_merchant/pulls/1748","_links":{"self":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/comments/32658588"},"html":{"href":"https://github.com/Shopify/active_merchant/pull/1748#discussion_r32658588"},"pull_request":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/1748"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/active_merchant/pulls/1748","id":37929243,"html_url":"https://github.com/Shopify/active_merchant/pull/1748","diff_url":"https://github.com/Shopify/active_merchant/pull/1748.diff","patch_url":"https://github.com/Shopify/active_merchant/pull/1748.patch","issue_url":"https://api.github.com/repos/Shopify/active_merchant/issues/1748","number":1748,"state":"open","locked":false,"title":"Support mapping Stripe advanced decline codes to standard codes","user":{"login":"abecevello","id":154184,"avatar_url":"https://avatars.githubusercontent.com/u/154184?v=3","gravatar_id":"","url":"https://api.github.com/users/abecevello","html_url":"https://github.com/abecevello","followers_url":"https://api.github.com/users/abecevello/followers","following_url":"https://api.github.com/users/abecevello/following{/other_user}","gists_url":"https://api.github.com/users/abecevello/gists{/gist_id}","starred_url":"https://api.github.com/users/abecevello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abecevello/subscriptions","organizations_url":"https://api.github.com/users/abecevello/orgs","repos_url":"https://api.github.com/users/abecevello/repos","events_url":"https://api.github.com/users/abecevello/events{/privacy}","received_events_url":"https://api.github.com/users/abecevello/received_events","type":"User","site_admin":false},"body":"Adds support for mapping Stripe advanced decline codes to the standard error codes.\r\n\r\nAlso adds a mapping for the 'call_issuer' advanced decline code to the standardized 'call_issuer' error code.\r\n\r\n@bizla @girasquid ","created_at":"2015-06-17T18:02:18Z","updated_at":"2015-06-17T18:28:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aaea34b3b44f2cb15c7463d8315356f3fbce5258","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/active_merchant/pulls/1748/commits","review_comments_url":"https://api.github.com/repos/Shopify/active_merchant/pulls/1748/comments","review_comment_url":"https://api.github.com/repos/Shopify/active_merchant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/active_merchant/issues/1748/comments","statuses_url":"https://api.github.com/repos/Shopify/active_merchant/statuses/7db96b3e59f8f46c383d98f14eba734f5be33b0b","head":{"label":"Shopify:stripe-advanced-decline-codes","ref":"stripe-advanced-decline-codes","sha":"7db96b3e59f8f46c383d98f14eba734f5be33b0b","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":18294,"name":"active_merchant","full_name":"Shopify/active_merchant","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/active_merchant","description":"Active Merchant is a simple payment abstraction library extracted from Shopify. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways.","fork":false,"url":"https://api.github.com/repos/Shopify/active_merchant","forks_url":"https://api.github.com/repos/Shopify/active_merchant/forks","keys_url":"https://api.github.com/repos/Shopify/active_merchant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/active_merchant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/active_merchant/teams","hooks_url":"https://api.github.com/repos/Shopify/active_merchant/hooks","issue_events_url":"https://api.github.com/repos/Shopify/active_merchant/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/active_merchant/events","assignees_url":"https://api.github.com/repos/Shopify/active_merchant/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/active_merchant/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/active_merchant/tags","blobs_url":"https://api.github.com/repos/Shopify/active_merchant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/active_merchant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/active_merchant/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/active_merchant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/active_merchant/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/active_merchant/languages","stargazers_url":"https://api.github.com/repos/Shopify/active_merchant/stargazers","contributors_url":"https://api.github.com/repos/Shopify/active_merchant/contributors","subscribers_url":"https://api.github.com/repos/Shopify/active_merchant/subscribers","subscription_url":"https://api.github.com/repos/Shopify/active_merchant/subscription","commits_url":"https://api.github.com/repos/Shopify/active_merchant/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/active_merchant/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/active_merchant/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/active_merchant/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/active_merchant/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/active_merchant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/active_merchant/merges","archive_url":"https://api.github.com/repos/Shopify/active_merchant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/active_merchant/downloads","issues_url":"https://api.github.com/repos/Shopify/active_merchant/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/active_merchant/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/active_merchant/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/active_merchant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/active_merchant/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/active_merchant/releases{/id}","created_at":"2008-05-20T13:53:26Z","updated_at":"2015-06-16T04:54:46Z","pushed_at":"2015-06-17T18:25:31Z","git_url":"git://github.com/Shopify/active_merchant.git","ssh_url":"git@github.com:Shopify/active_merchant.git","clone_url":"https://github.com/Shopify/active_merchant.git","svn_url":"https://github.com/Shopify/active_merchant","homepage":"http://activemerchant.org","size":34456,"stargazers_count":3080,"watchers_count":3080,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1706,"mirror_url":null,"open_issues_count":58,"forks":1706,"open_issues":58,"watchers":3080,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"d577f177eb8908faab709dea5e85e22323611b72","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":18294,"name":"active_merchant","full_name":"Shopify/active_merchant","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/active_merchant","description":"Active Merchant is a simple payment abstraction library extracted from Shopify. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways.","fork":false,"url":"https://api.github.com/repos/Shopify/active_merchant","forks_url":"https://api.github.com/repos/Shopify/active_merchant/forks","keys_url":"https://api.github.com/repos/Shopify/active_merchant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/active_merchant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/active_merchant/teams","hooks_url":"https://api.github.com/repos/Shopify/active_merchant/hooks","issue_events_url":"https://api.github.com/repos/Shopify/active_merchant/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/active_merchant/events","assignees_url":"https://api.github.com/repos/Shopify/active_merchant/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/active_merchant/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/active_merchant/tags","blobs_url":"https://api.github.com/repos/Shopify/active_merchant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/active_merchant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/active_merchant/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/active_merchant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/active_merchant/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/active_merchant/languages","stargazers_url":"https://api.github.com/repos/Shopify/active_merchant/stargazers","contributors_url":"https://api.github.com/repos/Shopify/active_merchant/contributors","subscribers_url":"https://api.github.com/repos/Shopify/active_merchant/subscribers","subscription_url":"https://api.github.com/repos/Shopify/active_merchant/subscription","commits_url":"https://api.github.com/repos/Shopify/active_merchant/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/active_merchant/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/active_merchant/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/active_merchant/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/active_merchant/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/active_merchant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/active_merchant/merges","archive_url":"https://api.github.com/repos/Shopify/active_merchant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/active_merchant/downloads","issues_url":"https://api.github.com/repos/Shopify/active_merchant/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/active_merchant/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/active_merchant/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/active_merchant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/active_merchant/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/active_merchant/releases{/id}","created_at":"2008-05-20T13:53:26Z","updated_at":"2015-06-16T04:54:46Z","pushed_at":"2015-06-17T18:25:31Z","git_url":"git://github.com/Shopify/active_merchant.git","ssh_url":"git@github.com:Shopify/active_merchant.git","clone_url":"https://github.com/Shopify/active_merchant.git","svn_url":"https://github.com/Shopify/active_merchant","homepage":"http://activemerchant.org","size":34456,"stargazers_count":3080,"watchers_count":3080,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1706,"mirror_url":null,"open_issues_count":58,"forks":1706,"open_issues":58,"watchers":3080,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/1748"},"html":{"href":"https://github.com/Shopify/active_merchant/pull/1748"},"issue":{"href":"https://api.github.com/repos/Shopify/active_merchant/issues/1748"},"comments":{"href":"https://api.github.com/repos/Shopify/active_merchant/issues/1748/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/1748/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/1748/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/active_merchant/statuses/7db96b3e59f8f46c383d98f14eba734f5be33b0b"}}}}