GitHub PullRequestReviewCommentEvent at 2014-07-30 18:51:31
Repository: fake-braspag
Actor: britto
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/comments/15604151","id":15604151,"diff_hunk":"@@ -156,4 +181,39 @@ def normalize_amount(amount)\n   def mask_card_number(card_number)\n     \"************%s\" % card_number[-4..-1] if card_number\n   end\n+\n+  # Internal: Checks if the order can be authorized.\n+  def can_be_authorized?\n+    @attributes['cardNumber'] != '4242424242424242'\n+  end\n+\n+  # Public: Retrive the order attributes using a method.\n+  #\n+  # Examples:\n+  #\n+  #   order = Order.new('amount' => '4.20', 'customerName' => 'Rafael França')\n+  #   order.amount # => \"4.20\"\n+  #   order.customer_name # => \"Rafael França\"\n+  def method_missing(name, *args)","path":"lib/models/order.rb","position":109,"original_position":109,"commit_id":"153c21f56f7e0dfeff00cb8ec3a13198d251c913","original_commit_id":"153c21f56f7e0dfeff00cb8ec3a13198d251c913","user":{"login":"britto","id":54433,"avatar_url":"https://avatars.githubusercontent.com/u/54433?v=1","gravatar_id":"c1a82c72ba94813047be93746c07a15d","url":"https://api.github.com/users/britto","html_url":"https://github.com/britto","followers_url":"https://api.github.com/users/britto/followers","following_url":"https://api.github.com/users/britto/following{/other_user}","gists_url":"https://api.github.com/users/britto/gists{/gist_id}","starred_url":"https://api.github.com/users/britto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/britto/subscriptions","organizations_url":"https://api.github.com/users/britto/orgs","repos_url":"https://api.github.com/users/britto/repos","events_url":"https://api.github.com/users/britto/events{/privacy}","received_events_url":"https://api.github.com/users/britto/received_events","type":"User","site_admin":false},"body":"hipster :man: ","created_at":"2014-07-30T18:51:31Z","updated_at":"2014-07-30T18:51:31Z","html_url":"https://github.com/Baby-com-br/fake-braspag/pull/3#discussion_r15604151","pull_request_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/comments/15604151"},"html":{"href":"https://github.com/Baby-com-br/fake-braspag/pull/3#discussion_r15604151"},"pull_request":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/3","id":19105554,"html_url":"https://github.com/Baby-com-br/fake-braspag/pull/3","diff_url":"https://github.com/Baby-com-br/fake-braspag/pull/3.diff","patch_url":"https://github.com/Baby-com-br/fake-braspag/pull/3.patch","issue_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues/3","number":3,"state":"open","title":"Respond with authorization failure with some credit cards","user":{"login":"rafaelfranca","id":47848,"avatar_url":"https://avatars.githubusercontent.com/u/47848?v=1","gravatar_id":"0525b332aafb83307b32d9747a93de03","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"body":"Now, if we try to authorize the card with the number `4242 4242 4242 4242` we will respond with an authotization failure.\r\n\r\nTo implement this I need to store the real card number on the database. Of course this mock will be not used on production but be aware that it is storing the credit card information before inputing you real credit card number on QA.\r\n\r\nThere are some changes to make possible to access the order attributes using methods instead of `[]` accessor. I made this because we need to return the masked credit card number when reading the information but store the real number. So we return the masked value when accessing `order.card_number` and to not having two different ways to access the attribute now we don't implement `[]` anymore.","created_at":"2014-07-30T17:51:19Z","updated_at":"2014-07-30T18:51:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ba5ea1b7cb046770edf233fc2ae557ab7261703","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues/3/comments","statuses_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/statuses/153c21f56f7e0dfeff00cb8ec3a13198d251c913","head":{"label":"Baby-com-br:rm-failure-authorization","ref":"rm-failure-authorization","sha":"153c21f56f7e0dfeff00cb8ec3a13198d251c913","user":{"login":"Baby-com-br","id":1762272,"avatar_url":"https://avatars.githubusercontent.com/u/1762272?v=1","gravatar_id":"67d753d0ce00e115a07cd3889a25ed61","url":"https://api.github.com/users/Baby-com-br","html_url":"https://github.com/Baby-com-br","followers_url":"https://api.github.com/users/Baby-com-br/followers","following_url":"https://api.github.com/users/Baby-com-br/following{/other_user}","gists_url":"https://api.github.com/users/Baby-com-br/gists{/gist_id}","starred_url":"https://api.github.com/users/Baby-com-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baby-com-br/subscriptions","organizations_url":"https://api.github.com/users/Baby-com-br/orgs","repos_url":"https://api.github.com/users/Baby-com-br/repos","events_url":"https://api.github.com/users/Baby-com-br/events{/privacy}","received_events_url":"https://api.github.com/users/Baby-com-br/received_events","type":"Organization","site_admin":false},"repo":{"id":11319630,"name":"fake-braspag","full_name":"Baby-com-br/fake-braspag","owner":{"login":"Baby-com-br","id":1762272,"avatar_url":"https://avatars.githubusercontent.com/u/1762272?v=1","gravatar_id":"67d753d0ce00e115a07cd3889a25ed61","url":"https://api.github.com/users/Baby-com-br","html_url":"https://github.com/Baby-com-br","followers_url":"https://api.github.com/users/Baby-com-br/followers","following_url":"https://api.github.com/users/Baby-com-br/following{/other_user}","gists_url":"https://api.github.com/users/Baby-com-br/gists{/gist_id}","starred_url":"https://api.github.com/users/Baby-com-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baby-com-br/subscriptions","organizations_url":"https://api.github.com/users/Baby-com-br/orgs","repos_url":"https://api.github.com/users/Baby-com-br/repos","events_url":"https://api.github.com/users/Baby-com-br/events{/privacy}","received_events_url":"https://api.github.com/users/Baby-com-br/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Baby-com-br/fake-braspag","description":"","fork":true,"url":"https://api.github.com/repos/Baby-com-br/fake-braspag","forks_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/forks","keys_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/teams","hooks_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/hooks","issue_events_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues/events{/number}","events_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/events","assignees_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/assignees{/user}","branches_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/branches{/branch}","tags_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/tags","blobs_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/refs{/sha}","trees_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/statuses/{sha}","languages_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/languages","stargazers_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/stargazers","contributors_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/contributors","subscribers_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/subscribers","subscription_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/subscription","commits_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/commits{/sha}","git_commits_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/commits{/sha}","comments_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/comments{/number}","issue_comment_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues/comments/{number}","contents_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/contents/{+path}","compare_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/merges","archive_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/downloads","issues_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues{/number}","pulls_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls{/number}","milestones_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/milestones{/number}","notifications_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/labels{/name}","releases_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/releases{/id}","created_at":"2013-07-10T18:01:20Z","updated_at":"2013-07-10T18:01:20Z","pushed_at":"2014-07-30T17:37:19Z","git_url":"git://github.com/Baby-com-br/fake-braspag.git","ssh_url":"git@github.com:Baby-com-br/fake-braspag.git","clone_url":"https://github.com/Baby-com-br/fake-braspag.git","svn_url":"https://github.com/Baby-com-br/fake-braspag","homepage":"","size":146,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Baby-com-br:next","ref":"next","sha":"e426572ac2f3f945055508e1f68e53c2a84e2bb6","user":{"login":"Baby-com-br","id":1762272,"avatar_url":"https://avatars.githubusercontent.com/u/1762272?v=1","gravatar_id":"67d753d0ce00e115a07cd3889a25ed61","url":"https://api.github.com/users/Baby-com-br","html_url":"https://github.com/Baby-com-br","followers_url":"https://api.github.com/users/Baby-com-br/followers","following_url":"https://api.github.com/users/Baby-com-br/following{/other_user}","gists_url":"https://api.github.com/users/Baby-com-br/gists{/gist_id}","starred_url":"https://api.github.com/users/Baby-com-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baby-com-br/subscriptions","organizations_url":"https://api.github.com/users/Baby-com-br/orgs","repos_url":"https://api.github.com/users/Baby-com-br/repos","events_url":"https://api.github.com/users/Baby-com-br/events{/privacy}","received_events_url":"https://api.github.com/users/Baby-com-br/received_events","type":"Organization","site_admin":false},"repo":{"id":11319630,"name":"fake-braspag","full_name":"Baby-com-br/fake-braspag","owner":{"login":"Baby-com-br","id":1762272,"avatar_url":"https://avatars.githubusercontent.com/u/1762272?v=1","gravatar_id":"67d753d0ce00e115a07cd3889a25ed61","url":"https://api.github.com/users/Baby-com-br","html_url":"https://github.com/Baby-com-br","followers_url":"https://api.github.com/users/Baby-com-br/followers","following_url":"https://api.github.com/users/Baby-com-br/following{/other_user}","gists_url":"https://api.github.com/users/Baby-com-br/gists{/gist_id}","starred_url":"https://api.github.com/users/Baby-com-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baby-com-br/subscriptions","organizations_url":"https://api.github.com/users/Baby-com-br/orgs","repos_url":"https://api.github.com/users/Baby-com-br/repos","events_url":"https://api.github.com/users/Baby-com-br/events{/privacy}","received_events_url":"https://api.github.com/users/Baby-com-br/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Baby-com-br/fake-braspag","description":"","fork":true,"url":"https://api.github.com/repos/Baby-com-br/fake-braspag","forks_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/forks","keys_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/teams","hooks_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/hooks","issue_events_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues/events{/number}","events_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/events","assignees_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/assignees{/user}","branches_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/branches{/branch}","tags_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/tags","blobs_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/refs{/sha}","trees_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/statuses/{sha}","languages_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/languages","stargazers_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/stargazers","contributors_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/contributors","subscribers_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/subscribers","subscription_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/subscription","commits_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/commits{/sha}","git_commits_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/git/commits{/sha}","comments_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/comments{/number}","issue_comment_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues/comments/{number}","contents_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/contents/{+path}","compare_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/merges","archive_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/downloads","issues_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues{/number}","pulls_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls{/number}","milestones_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/milestones{/number}","notifications_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/labels{/name}","releases_url":"https://api.github.com/repos/Baby-com-br/fake-braspag/releases{/id}","created_at":"2013-07-10T18:01:20Z","updated_at":"2013-07-10T18:01:20Z","pushed_at":"2014-07-30T17:37:19Z","git_url":"git://github.com/Baby-com-br/fake-braspag.git","ssh_url":"git@github.com:Baby-com-br/fake-braspag.git","clone_url":"https://github.com/Baby-com-br/fake-braspag.git","svn_url":"https://github.com/Baby-com-br/fake-braspag","homepage":"","size":146,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/3"},"html":{"href":"https://github.com/Baby-com-br/fake-braspag/pull/3"},"issue":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues/3"},"comments":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Baby-com-br/fake-braspag/statuses/153c21f56f7e0dfeff00cb8ec3a13198d251c913"}}}}