{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/solitude/pulls/comments/28885523","id":28885523,"diff_hunk":"@@ -0,0 +1,95 @@\n+from django.conf import settings\n+from django.core.exceptions import ImproperlyConfigured\n+from django.http import Http404\n+from django_statsd.clients import statsd\n+\n+import braintree\n+from braintree.configuration import Configuration\n+from braintree.util.xml_util import XmlUtil\n+\n+\n+class Http(braintree.util.http.Http):\n+\n+    @staticmethod\n+    def raise_exception_from_status(status, message=None):\n+        \"\"\"\n+        It would be nice if a 404 from Braintree became a 404 from Django\n+        as opposed to a 500 error.\n+\n+        This method allows us to override the exception response.\n+        \"\"\"\n+        statsd.incr('solitude.bango.response.{0}'.format(status))","path":"lib/brains/client.py","position":21,"original_position":21,"commit_id":"08c6bacbdcf0d91816f2a9af4d6acde46818845b","original_commit_id":"08c6bacbdcf0d91816f2a9af4d6acde46818845b","user":{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false},"body":"not bango ;)","created_at":"2015-04-22T15:47:22Z","updated_at":"2015-04-22T15:47:22Z","html_url":"https://github.com/mozilla/solitude/pull/354#discussion_r28885523","pull_request_url":"https://api.github.com/repos/mozilla/solitude/pulls/354","_links":{"self":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/comments/28885523"},"html":{"href":"https://github.com/mozilla/solitude/pull/354#discussion_r28885523"},"pull_request":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/354"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/solitude/pulls/354","id":33692495,"html_url":"https://github.com/mozilla/solitude/pull/354","diff_url":"https://github.com/mozilla/solitude/pull/354.diff","patch_url":"https://github.com/mozilla/solitude/pull/354.patch","issue_url":"https://api.github.com/repos/mozilla/solitude/issues/354","number":354,"state":"open","locked":false,"title":"stand up braintree libs and settings (fixes #350)","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"body":"```\r\nbash-4.1# python manage.py  shell\r\n[snip]\r\nIn [1]: from lib.brains.client import get_client\r\n\r\nIn [2]: from django.http import Http404\r\n\r\nIn [3]: client = get_client()\r\n\r\nIn [4]: try:\r\n   ...:     customer = client.Customer.find('123')\r\n   ...: except Http404:\r\n   ...:     print 'not found'\r\n   ...:     \r\nnot found\r\n```\r\n\r\nJust some initial config.","created_at":"2015-04-20T18:29:16Z","updated_at":"2015-04-22T15:47:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"862222f0e795572d2bec2d2939827cbad4abb0ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/solitude/pulls/354/commits","review_comments_url":"https://api.github.com/repos/mozilla/solitude/pulls/354/comments","review_comment_url":"https://api.github.com/repos/mozilla/solitude/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/solitude/issues/354/comments","statuses_url":"https://api.github.com/repos/mozilla/solitude/statuses/08c6bacbdcf0d91816f2a9af4d6acde46818845b","head":{"label":"andymckay:350","ref":"350","sha":"08c6bacbdcf0d91816f2a9af4d6acde46818845b","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"repo":{"id":23588659,"name":"solitude","full_name":"andymckay/solitude","owner":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andymckay/solitude","description":"A server for processing payments for Mozilla’s Marketplace and Add-ons site.","fork":true,"url":"https://api.github.com/repos/andymckay/solitude","forks_url":"https://api.github.com/repos/andymckay/solitude/forks","keys_url":"https://api.github.com/repos/andymckay/solitude/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andymckay/solitude/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andymckay/solitude/teams","hooks_url":"https://api.github.com/repos/andymckay/solitude/hooks","issue_events_url":"https://api.github.com/repos/andymckay/solitude/issues/events{/number}","events_url":"https://api.github.com/repos/andymckay/solitude/events","assignees_url":"https://api.github.com/repos/andymckay/solitude/assignees{/user}","branches_url":"https://api.github.com/repos/andymckay/solitude/branches{/branch}","tags_url":"https://api.github.com/repos/andymckay/solitude/tags","blobs_url":"https://api.github.com/repos/andymckay/solitude/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andymckay/solitude/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andymckay/solitude/git/refs{/sha}","trees_url":"https://api.github.com/repos/andymckay/solitude/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andymckay/solitude/statuses/{sha}","languages_url":"https://api.github.com/repos/andymckay/solitude/languages","stargazers_url":"https://api.github.com/repos/andymckay/solitude/stargazers","contributors_url":"https://api.github.com/repos/andymckay/solitude/contributors","subscribers_url":"https://api.github.com/repos/andymckay/solitude/subscribers","subscription_url":"https://api.github.com/repos/andymckay/solitude/subscription","commits_url":"https://api.github.com/repos/andymckay/solitude/commits{/sha}","git_commits_url":"https://api.github.com/repos/andymckay/solitude/git/commits{/sha}","comments_url":"https://api.github.com/repos/andymckay/solitude/comments{/number}","issue_comment_url":"https://api.github.com/repos/andymckay/solitude/issues/comments{/number}","contents_url":"https://api.github.com/repos/andymckay/solitude/contents/{+path}","compare_url":"https://api.github.com/repos/andymckay/solitude/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andymckay/solitude/merges","archive_url":"https://api.github.com/repos/andymckay/solitude/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andymckay/solitude/downloads","issues_url":"https://api.github.com/repos/andymckay/solitude/issues{/number}","pulls_url":"https://api.github.com/repos/andymckay/solitude/pulls{/number}","milestones_url":"https://api.github.com/repos/andymckay/solitude/milestones{/number}","notifications_url":"https://api.github.com/repos/andymckay/solitude/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andymckay/solitude/labels{/name}","releases_url":"https://api.github.com/repos/andymckay/solitude/releases{/id}","created_at":"2014-09-02T17:37:20Z","updated_at":"2015-04-19T15:06:31Z","pushed_at":"2015-04-21T22:46:34Z","git_url":"git://github.com/andymckay/solitude.git","ssh_url":"git@github.com:andymckay/solitude.git","clone_url":"https://github.com/andymckay/solitude.git","svn_url":"https://github.com/andymckay/solitude","homepage":"http://readthedocs.org/docs/solitude/en/latest/","size":3499,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"df8ec41743f4acac4bf2e39b71c853c9b3ed790a","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":4566171,"name":"solitude","full_name":"mozilla/solitude","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/solitude","description":"A server for processing payments for Mozilla’s Marketplace.","fork":false,"url":"https://api.github.com/repos/mozilla/solitude","forks_url":"https://api.github.com/repos/mozilla/solitude/forks","keys_url":"https://api.github.com/repos/mozilla/solitude/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/solitude/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/solitude/teams","hooks_url":"https://api.github.com/repos/mozilla/solitude/hooks","issue_events_url":"https://api.github.com/repos/mozilla/solitude/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/solitude/events","assignees_url":"https://api.github.com/repos/mozilla/solitude/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/solitude/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/solitude/tags","blobs_url":"https://api.github.com/repos/mozilla/solitude/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/solitude/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/solitude/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/solitude/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/solitude/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/solitude/languages","stargazers_url":"https://api.github.com/repos/mozilla/solitude/stargazers","contributors_url":"https://api.github.com/repos/mozilla/solitude/contributors","subscribers_url":"https://api.github.com/repos/mozilla/solitude/subscribers","subscription_url":"https://api.github.com/repos/mozilla/solitude/subscription","commits_url":"https://api.github.com/repos/mozilla/solitude/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/solitude/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/solitude/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/solitude/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/solitude/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/solitude/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/solitude/merges","archive_url":"https://api.github.com/repos/mozilla/solitude/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/solitude/downloads","issues_url":"https://api.github.com/repos/mozilla/solitude/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/solitude/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/solitude/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/solitude/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/solitude/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/solitude/releases{/id}","created_at":"2012-06-05T22:13:53Z","updated_at":"2015-04-21T23:01:46Z","pushed_at":"2015-04-21T23:01:46Z","git_url":"git://github.com/mozilla/solitude.git","ssh_url":"git@github.com:mozilla/solitude.git","clone_url":"https://github.com/mozilla/solitude.git","svn_url":"https://github.com/mozilla/solitude","homepage":"http://readthedocs.org/docs/solitude/en/latest/","size":6631,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":13,"forks":26,"open_issues":13,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/354"},"html":{"href":"https://github.com/mozilla/solitude/pull/354"},"issue":{"href":"https://api.github.com/repos/mozilla/solitude/issues/354"},"comments":{"href":"https://api.github.com/repos/mozilla/solitude/issues/354/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/354/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/solitude/pulls/354/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/solitude/statuses/08c6bacbdcf0d91816f2a9af4d6acde46818845b"}}}}