{"action":"created","comment":{"url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments/44925597","id":44925597,"diff_hunk":"@@ -30,19 +30,8 @@ def sale\n               email: @user[:email]\n             }\n           )\n-          process_response(transaction)\n         end\n-\n-        def process_response(braintree_response)\n-          puts \"processing response\"\n-          if braintree_response.success?\n-            { success: true, transaction_id: braintree_response.transaction.id }.to_json\n-          else\n-            { success: false, errors: [] }.to_json\n-          end\n-        end\n-\n       end\n     end\n   end","path":"lib/payment_processor/clients/braintree/transaction.rb","position":27,"original_position":27,"commit_id":"1614b22d3dde6829a8efebdcf5f4d13bf7884465","original_commit_id":"1614b22d3dde6829a8efebdcf5f4d13bf7884465","user":{"login":"osahyoun","id":12949,"avatar_url":"https://avatars.githubusercontent.com/u/12949?v=3","gravatar_id":"","url":"https://api.github.com/users/osahyoun","html_url":"https://github.com/osahyoun","followers_url":"https://api.github.com/users/osahyoun/followers","following_url":"https://api.github.com/users/osahyoun/following{/other_user}","gists_url":"https://api.github.com/users/osahyoun/gists{/gist_id}","starred_url":"https://api.github.com/users/osahyoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osahyoun/subscriptions","organizations_url":"https://api.github.com/users/osahyoun/orgs","repos_url":"https://api.github.com/users/osahyoun/repos","events_url":"https://api.github.com/users/osahyoun/events{/privacy}","received_events_url":"https://api.github.com/users/osahyoun/received_events","type":"User","site_admin":false},"body":"@Tuuleh I'd suggest you don't process the response here. The response hash is actually a view, and should be handled as a separate concern. Here, I've moved it back to the controller... for more complicated JSON objects I'd consider using `jbuilder` view templates. And if your template(s) end up having lots of view logic, then I'd use Rails' helper methods or you can wrap your transaction object with an object concerned only with presentation (https://github.com/drapergem/draper might be helpful, although probably not necessary).","created_at":"2015-11-16T14:01:14Z","updated_at":"2015-11-16T14:01:14Z","html_url":"https://github.com/SumOfUs/Champaign/pull/232#discussion_r44925597","pull_request_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/232","_links":{"self":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments/44925597"},"html":{"href":"https://github.com/SumOfUs/Champaign/pull/232#discussion_r44925597"},"pull_request":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/232"}}},"pull_request":{"url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/232","id":50812111,"html_url":"https://github.com/SumOfUs/Champaign/pull/232","diff_url":"https://github.com/SumOfUs/Champaign/pull/232.diff","patch_url":"https://github.com/SumOfUs/Champaign/pull/232.patch","issue_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/232","number":232,"state":"open","locked":false,"title":"Braintree edits","user":{"login":"osahyoun","id":12949,"avatar_url":"https://avatars.githubusercontent.com/u/12949?v=3","gravatar_id":"","url":"https://api.github.com/users/osahyoun","html_url":"https://github.com/osahyoun","followers_url":"https://api.github.com/users/osahyoun/followers","following_url":"https://api.github.com/users/osahyoun/following{/other_user}","gists_url":"https://api.github.com/users/osahyoun/gists{/gist_id}","starred_url":"https://api.github.com/users/osahyoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osahyoun/subscriptions","organizations_url":"https://api.github.com/users/osahyoun/orgs","repos_url":"https://api.github.com/users/osahyoun/repos","events_url":"https://api.github.com/users/osahyoun/events{/privacy}","received_events_url":"https://api.github.com/users/osahyoun/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-16T13:51:42Z","updated_at":"2015-11-16T14:01:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d79770766e21e61438d717ba66707a92791199f4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/232/commits","review_comments_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/232/comments","review_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/232/comments","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/1614b22d3dde6829a8efebdcf5f4d13bf7884465","head":{"label":"SumOfUs:braintree_edits","ref":"braintree_edits","sha":"1614b22d3dde6829a8efebdcf5f4d13bf7884465","user":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"repo":{"id":33684818,"name":"Champaign","full_name":"SumOfUs/Champaign","owner":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SumOfUs/Champaign","description":"SumOfUs Online Campaign Platform.","fork":false,"url":"https://api.github.com/repos/SumOfUs/Champaign","forks_url":"https://api.github.com/repos/SumOfUs/Champaign/forks","keys_url":"https://api.github.com/repos/SumOfUs/Champaign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SumOfUs/Champaign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SumOfUs/Champaign/teams","hooks_url":"https://api.github.com/repos/SumOfUs/Champaign/hooks","issue_events_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/events{/number}","events_url":"https://api.github.com/repos/SumOfUs/Champaign/events","assignees_url":"https://api.github.com/repos/SumOfUs/Champaign/assignees{/user}","branches_url":"https://api.github.com/repos/SumOfUs/Champaign/branches{/branch}","tags_url":"https://api.github.com/repos/SumOfUs/Champaign/tags","blobs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SumOfUs/Champaign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/refs{/sha}","trees_url":"https://api.github.com/repos/SumOfUs/Champaign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/{sha}","languages_url":"https://api.github.com/repos/SumOfUs/Champaign/languages","stargazers_url":"https://api.github.com/repos/SumOfUs/Champaign/stargazers","contributors_url":"https://api.github.com/repos/SumOfUs/Champaign/contributors","subscribers_url":"https://api.github.com/repos/SumOfUs/Champaign/subscribers","subscription_url":"https://api.github.com/repos/SumOfUs/Champaign/subscription","commits_url":"https://api.github.com/repos/SumOfUs/Champaign/commits{/sha}","git_commits_url":"https://api.github.com/repos/SumOfUs/Champaign/git/commits{/sha}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/comments{/number}","issue_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/comments{/number}","contents_url":"https://api.github.com/repos/SumOfUs/Champaign/contents/{+path}","compare_url":"https://api.github.com/repos/SumOfUs/Champaign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SumOfUs/Champaign/merges","archive_url":"https://api.github.com/repos/SumOfUs/Champaign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SumOfUs/Champaign/downloads","issues_url":"https://api.github.com/repos/SumOfUs/Champaign/issues{/number}","pulls_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls{/number}","milestones_url":"https://api.github.com/repos/SumOfUs/Champaign/milestones{/number}","notifications_url":"https://api.github.com/repos/SumOfUs/Champaign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SumOfUs/Champaign/labels{/name}","releases_url":"https://api.github.com/repos/SumOfUs/Champaign/releases{/id}","created_at":"2015-04-09T18:16:20Z","updated_at":"2015-11-03T08:48:34Z","pushed_at":"2015-11-16T13:51:42Z","git_url":"git://github.com/SumOfUs/Champaign.git","ssh_url":"git@github.com:SumOfUs/Champaign.git","clone_url":"https://github.com/SumOfUs/Champaign.git","svn_url":"https://github.com/SumOfUs/Champaign","homepage":null,"size":5225,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":17,"forks":1,"open_issues":17,"watchers":8,"default_branch":"development"}},"base":{"label":"SumOfUs:braintree","ref":"braintree","sha":"0f143f334fe924ea6a5581f674e8f7de4cd8f2cd","user":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"repo":{"id":33684818,"name":"Champaign","full_name":"SumOfUs/Champaign","owner":{"login":"SumOfUs","id":7574652,"avatar_url":"https://avatars.githubusercontent.com/u/7574652?v=3","gravatar_id":"","url":"https://api.github.com/users/SumOfUs","html_url":"https://github.com/SumOfUs","followers_url":"https://api.github.com/users/SumOfUs/followers","following_url":"https://api.github.com/users/SumOfUs/following{/other_user}","gists_url":"https://api.github.com/users/SumOfUs/gists{/gist_id}","starred_url":"https://api.github.com/users/SumOfUs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SumOfUs/subscriptions","organizations_url":"https://api.github.com/users/SumOfUs/orgs","repos_url":"https://api.github.com/users/SumOfUs/repos","events_url":"https://api.github.com/users/SumOfUs/events{/privacy}","received_events_url":"https://api.github.com/users/SumOfUs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SumOfUs/Champaign","description":"SumOfUs Online Campaign Platform.","fork":false,"url":"https://api.github.com/repos/SumOfUs/Champaign","forks_url":"https://api.github.com/repos/SumOfUs/Champaign/forks","keys_url":"https://api.github.com/repos/SumOfUs/Champaign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SumOfUs/Champaign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SumOfUs/Champaign/teams","hooks_url":"https://api.github.com/repos/SumOfUs/Champaign/hooks","issue_events_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/events{/number}","events_url":"https://api.github.com/repos/SumOfUs/Champaign/events","assignees_url":"https://api.github.com/repos/SumOfUs/Champaign/assignees{/user}","branches_url":"https://api.github.com/repos/SumOfUs/Champaign/branches{/branch}","tags_url":"https://api.github.com/repos/SumOfUs/Champaign/tags","blobs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SumOfUs/Champaign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SumOfUs/Champaign/git/refs{/sha}","trees_url":"https://api.github.com/repos/SumOfUs/Champaign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SumOfUs/Champaign/statuses/{sha}","languages_url":"https://api.github.com/repos/SumOfUs/Champaign/languages","stargazers_url":"https://api.github.com/repos/SumOfUs/Champaign/stargazers","contributors_url":"https://api.github.com/repos/SumOfUs/Champaign/contributors","subscribers_url":"https://api.github.com/repos/SumOfUs/Champaign/subscribers","subscription_url":"https://api.github.com/repos/SumOfUs/Champaign/subscription","commits_url":"https://api.github.com/repos/SumOfUs/Champaign/commits{/sha}","git_commits_url":"https://api.github.com/repos/SumOfUs/Champaign/git/commits{/sha}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/comments{/number}","issue_comment_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/comments{/number}","contents_url":"https://api.github.com/repos/SumOfUs/Champaign/contents/{+path}","compare_url":"https://api.github.com/repos/SumOfUs/Champaign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SumOfUs/Champaign/merges","archive_url":"https://api.github.com/repos/SumOfUs/Champaign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SumOfUs/Champaign/downloads","issues_url":"https://api.github.com/repos/SumOfUs/Champaign/issues{/number}","pulls_url":"https://api.github.com/repos/SumOfUs/Champaign/pulls{/number}","milestones_url":"https://api.github.com/repos/SumOfUs/Champaign/milestones{/number}","notifications_url":"https://api.github.com/repos/SumOfUs/Champaign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SumOfUs/Champaign/labels{/name}","releases_url":"https://api.github.com/repos/SumOfUs/Champaign/releases{/id}","created_at":"2015-04-09T18:16:20Z","updated_at":"2015-11-03T08:48:34Z","pushed_at":"2015-11-16T13:51:42Z","git_url":"git://github.com/SumOfUs/Champaign.git","ssh_url":"git@github.com:SumOfUs/Champaign.git","clone_url":"https://github.com/SumOfUs/Champaign.git","svn_url":"https://github.com/SumOfUs/Champaign","homepage":null,"size":5225,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":17,"forks":1,"open_issues":17,"watchers":8,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/232"},"html":{"href":"https://github.com/SumOfUs/Champaign/pull/232"},"issue":{"href":"https://api.github.com/repos/SumOfUs/Champaign/issues/232"},"comments":{"href":"https://api.github.com/repos/SumOfUs/Champaign/issues/232/comments"},"review_comments":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/232/comments"},"review_comment":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SumOfUs/Champaign/pulls/232/commits"},"statuses":{"href":"https://api.github.com/repos/SumOfUs/Champaign/statuses/1614b22d3dde6829a8efebdcf5f4d13bf7884465"}}}}