{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/active_merchant/pulls/comments/22716491","id":22716491,"diff_hunk":"@@ -204,44 +198,36 @@ def post_data(data = {})\n       end\n \n       def headers(method, uri)\n+        raise ArgumentError, \"Invalid HTTP method: #{method}. Valid methods are :post and :get\" unless [:post, :get].include?(method)\n         request_uri = URI.parse(uri)\n \n-        request_class = case method\n-        when :post\n-          Net::HTTP::Post\n-        when :get\n-          Net::HTTP::Get\n-        else\n-          raise ArgumentError, \"Invalid HTTP method: #{method}. Valid methods are :post and :get\"\n-        end\n+        # Following the guidelines from http://nouncer.com/oauth/authentication.html\n+        oauth_parameters = {\n+          oauth_nonce: generate_unique_id,\n+          oauth_timestamp: Time.now.to_i.to_s,\n+          oauth_signature_method: 'HMAC-SHA1',\n+          oauth_version: \"1.0\",\n+          oauth_consumer_key: @options[:consumer_key],\n+          oauth_token: @options[:access_token]\n+        }\n \n-        # required for Ruby 1.9 backwards compatibilty","path":"lib/active_merchant/billing/gateways/quickbooks.rb","position":35,"original_position":35,"commit_id":"03b6e5ec2907850167937cb30cb3078f8e91200c","original_commit_id":"03b6e5ec2907850167937cb30cb3078f8e91200c","user":{"login":"girasquid","id":60324,"avatar_url":"https://avatars.githubusercontent.com/u/60324?v=3","gravatar_id":"","url":"https://api.github.com/users/girasquid","html_url":"https://github.com/girasquid","followers_url":"https://api.github.com/users/girasquid/followers","following_url":"https://api.github.com/users/girasquid/following{/other_user}","gists_url":"https://api.github.com/users/girasquid/gists{/gist_id}","starred_url":"https://api.github.com/users/girasquid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girasquid/subscriptions","organizations_url":"https://api.github.com/users/girasquid/orgs","repos_url":"https://api.github.com/users/girasquid/repos","events_url":"https://api.github.com/users/girasquid/events{/privacy}","received_events_url":"https://api.github.com/users/girasquid/received_events","type":"User","site_admin":false},"body":":cool: ","created_at":"2015-01-09T13:54:18Z","updated_at":"2015-01-09T13:54:18Z","html_url":"https://github.com/Shopify/active_merchant/pull/1520#discussion_r22716491","pull_request_url":"https://api.github.com/repos/Shopify/active_merchant/pulls/1520","_links":{"self":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/comments/22716491"},"html":{"href":"https://github.com/Shopify/active_merchant/pull/1520#discussion_r22716491"},"pull_request":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/1520"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/active_merchant/pulls/1520","id":27070049,"html_url":"https://github.com/Shopify/active_merchant/pull/1520","diff_url":"https://github.com/Shopify/active_merchant/pull/1520.diff","patch_url":"https://github.com/Shopify/active_merchant/pull/1520.patch","issue_url":"https://api.github.com/repos/Shopify/active_merchant/issues/1520","number":1520,"state":"open","locked":false,"title":"[QuickBooks Payments] remove oauth gem, implement OAuth request signing in QuickbooksGateway","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":"Upon inspection of the `oauth` gem at https://github.com/oauth-xx/oauth-ruby, we noticed [the default HMAC-SHA1 mechanism](https://github.com/oauth-xx/oauth-ruby/blob/master/lib/digest/hmac.rb) used to sign requests is [officially discouraged](http://www.ruby-doc.org/stdlib-2.0/libdoc/digest/rdoc/Digest/HMAC.html) and thus unacceptable for deployment in a PCI environment. \r\n\r\nThis removes the gem dependency and isolates OAuth 1.0a request signing into the QuickBooks Payments adapter, and uses the OpenSSL implementation of HMAC instead, as suggested by the official Ruby documentation.\r\n\r\n@girasquid @ntalbott /cc @Shopify/active-merchant ","created_at":"2015-01-08T23:48:11Z","updated_at":"2015-01-09T13:54:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82b44d636028b66d96ea7e67fe95a8b5fce549ee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/active_merchant/pulls/1520/commits","review_comments_url":"https://api.github.com/repos/Shopify/active_merchant/pulls/1520/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/1520/comments","statuses_url":"https://api.github.com/repos/Shopify/active_merchant/statuses/03b6e5ec2907850167937cb30cb3078f8e91200c","head":{"label":"Shopify:quickbooks_isolate_oauth","ref":"quickbooks_isolate_oauth","sha":"03b6e5ec2907850167937cb30cb3078f8e91200c","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-01-09T13:25:41Z","pushed_at":"2015-01-09T13:39:59Z","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":31103,"stargazers_count":2909,"watchers_count":2909,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1592,"mirror_url":null,"open_issues_count":31,"forks":1592,"open_issues":31,"watchers":2909,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"f621d883ea63845a8bcbd3d0aaf70b8319102ab7","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-01-09T13:25:41Z","pushed_at":"2015-01-09T13:39:59Z","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":31103,"stargazers_count":2909,"watchers_count":2909,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1592,"mirror_url":null,"open_issues_count":31,"forks":1592,"open_issues":31,"watchers":2909,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/1520"},"html":{"href":"https://github.com/Shopify/active_merchant/pull/1520"},"issue":{"href":"https://api.github.com/repos/Shopify/active_merchant/issues/1520"},"comments":{"href":"https://api.github.com/repos/Shopify/active_merchant/issues/1520/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/active_merchant/pulls/1520/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/1520/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/active_merchant/statuses/03b6e5ec2907850167937cb30cb3078f8e91200c"}}}}