{"action":"created","comment":{"url":"https://api.github.com/repos/activemerchant/active_merchant/pulls/comments/86681787","pull_request_review_id":7329157,"id":86681787,"diff_hunk":"@@ -0,0 +1,154 @@\n+require 'test_helper'\n+\n+class FlowTest < Test::Unit::TestCase\n+  def setup\n+    @gateway = FlowGateway.new(api_key: 'test', organization: 'org-test')\n+    @credit_card = credit_card\n+    @amount = 100\n+\n+    @options = {\n+      order_id: '1',\n+      billing_address: address,\n+      description: 'Store Purchase',\n+      customer: {}\n+    }\n+\n+    @internal_client = @gateway.instance_variable_get(:@client)\n+  end\n+\n+  def test_successful_purchase_with_token\n+    auths_stub = stub(:authorizations)\n+    @internal_client.expects(:authorizations).returns(auths_stub)\n+    auths_stub.expects(:post).with('org-test', anything).returns(successful_authorize_response)\n+    captures_stub = stub(:captures)\n+    @internal_client.expects(:captures).returns(captures_stub)\n+    captures_stub.expects(:post).with('org-test', anything).returns(successful_capture_response)\n+    response = @gateway.purchase(@amount, 'card-token', @options)\n+    assert_success response\n+\n+    assert_equal 'auth-id', response.authorization\n+  end\n+\n+  def test_failed_purchase_with_failed_authorization\n+    auths_stub = stub(:authorizations)\n+    @internal_client.expects(:authorizations).returns(auths_stub)\n+    auths_stub.expects(:post).with('org-test', anything).returns(failed_authorize_response)\n+\n+    response = @gateway.purchase(@amount, 'card-token', @options)\n+    assert_failure response\n+    assert_equal Gateway::STANDARD_ERROR_CODE[:card_declined], response.error_code\n+  end\n+\n+  def test_successful_authorize\n+  end\n+\n+  def test_failed_authorize\n+  end\n+\n+  def test_successful_capture\n+  end\n+\n+  def test_failed_capture\n+  end\n+\n+  def test_successful_refund\n+  end\n+\n+  def test_failed_refund\n+  end\n+\n+  def test_successful_void\n+  end\n+\n+  def test_failed_void\n+  end\n+\n+  def test_successful_verify\n+  end\n+\n+  def test_successful_verify_with_failed_void\n+  end\n+\n+  def test_failed_verify\n+  end\n+\n+  private\n+\n+  def successful_authorize_response\n+    Io::Flow::V0::Models::Authorization.new(\n+      id: 'auth-id',\n+      key: 'auth-id',\n+      card: Io::Flow::V0::Models::CardReference.new(\n+        id: 'card-id',\n+        token: 'card-token'\n+      ),\n+      amount: BigDecimal.new(@amount),\n+      currency: 'USD',\n+      customer: Io::Flow::V0::Models::Customer.new(\n+        name: Io::Flow::V0::Models::Name.new(first: 'Joe', last: 'Smith'),","path":"test/unit/gateways/flow_test.rb","position":88,"original_position":88,"commit_id":"8b16e8ba3482566cc1c3497a995b4b9d6f36e7da","original_commit_id":"8b16e8ba3482566cc1c3497a995b4b9d6f36e7da","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Avoid comma after the last parameter of a method call.","created_at":"2016-11-06T09:00:09Z","updated_at":"2016-11-06T09:00:09Z","html_url":"https://github.com/activemerchant/active_merchant/pull/2243#discussion_r86681787","pull_request_url":"https://api.github.com/repos/activemerchant/active_merchant/pulls/2243","_links":{"self":{"href":"https://api.github.com/repos/activemerchant/active_merchant/pulls/comments/86681787"},"html":{"href":"https://github.com/activemerchant/active_merchant/pull/2243#discussion_r86681787"},"pull_request":{"href":"https://api.github.com/repos/activemerchant/active_merchant/pulls/2243"}}},"pull_request":{"url":"https://api.github.com/repos/activemerchant/active_merchant/pulls/2243","id":90737297,"html_url":"https://github.com/activemerchant/active_merchant/pull/2243","diff_url":"https://github.com/activemerchant/active_merchant/pull/2243.diff","patch_url":"https://github.com/activemerchant/active_merchant/pull/2243.patch","issue_url":"https://api.github.com/repos/activemerchant/active_merchant/issues/2243","number":2243,"state":"open","locked":false,"title":"Flowio Gateway","user":{"login":"Tonkpils","id":1507561,"avatar_url":"https://avatars.githubusercontent.com/u/1507561?v=3","gravatar_id":"","url":"https://api.github.com/users/Tonkpils","html_url":"https://github.com/Tonkpils","followers_url":"https://api.github.com/users/Tonkpils/followers","following_url":"https://api.github.com/users/Tonkpils/following{/other_user}","gists_url":"https://api.github.com/users/Tonkpils/gists{/gist_id}","starred_url":"https://api.github.com/users/Tonkpils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tonkpils/subscriptions","organizations_url":"https://api.github.com/users/Tonkpils/orgs","repos_url":"https://api.github.com/users/Tonkpils/repos","events_url":"https://api.github.com/users/Tonkpils/events{/privacy}","received_events_url":"https://api.github.com/users/Tonkpils/received_events","type":"User","site_admin":false},"body":"I'm going to go ahead and open a PR for comments and suggestions on the implementation. \n\nI also made an issue which has gone unanswered https://github.com/activemerchant/active_merchant/issues/2224. I'm using the gem in production for about a week so far and it is working thus far with this code. \n\nLet me know if there's anything else I should add/remove/change. I'd be happy to make any changes to have this merged. \n","created_at":"2016-10-25T04:25:06Z","updated_at":"2016-11-06T09:00:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"787a9f43540aacae2ef70763af89f7f5f40e877b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/activemerchant/active_merchant/pulls/2243/commits","review_comments_url":"https://api.github.com/repos/activemerchant/active_merchant/pulls/2243/comments","review_comment_url":"https://api.github.com/repos/activemerchant/active_merchant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/activemerchant/active_merchant/issues/2243/comments","statuses_url":"https://api.github.com/repos/activemerchant/active_merchant/statuses/8b16e8ba3482566cc1c3497a995b4b9d6f36e7da","head":{"label":"Tonkpils:flowio","ref":"flowio","sha":"8b16e8ba3482566cc1c3497a995b4b9d6f36e7da","user":{"login":"Tonkpils","id":1507561,"avatar_url":"https://avatars.githubusercontent.com/u/1507561?v=3","gravatar_id":"","url":"https://api.github.com/users/Tonkpils","html_url":"https://github.com/Tonkpils","followers_url":"https://api.github.com/users/Tonkpils/followers","following_url":"https://api.github.com/users/Tonkpils/following{/other_user}","gists_url":"https://api.github.com/users/Tonkpils/gists{/gist_id}","starred_url":"https://api.github.com/users/Tonkpils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tonkpils/subscriptions","organizations_url":"https://api.github.com/users/Tonkpils/orgs","repos_url":"https://api.github.com/users/Tonkpils/repos","events_url":"https://api.github.com/users/Tonkpils/events{/privacy}","received_events_url":"https://api.github.com/users/Tonkpils/received_events","type":"User","site_admin":false},"repo":{"id":68313824,"name":"active_merchant","full_name":"Tonkpils/active_merchant","owner":{"login":"Tonkpils","id":1507561,"avatar_url":"https://avatars.githubusercontent.com/u/1507561?v=3","gravatar_id":"","url":"https://api.github.com/users/Tonkpils","html_url":"https://github.com/Tonkpils","followers_url":"https://api.github.com/users/Tonkpils/followers","following_url":"https://api.github.com/users/Tonkpils/following{/other_user}","gists_url":"https://api.github.com/users/Tonkpils/gists{/gist_id}","starred_url":"https://api.github.com/users/Tonkpils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tonkpils/subscriptions","organizations_url":"https://api.github.com/users/Tonkpils/orgs","repos_url":"https://api.github.com/users/Tonkpils/repos","events_url":"https://api.github.com/users/Tonkpils/events{/privacy}","received_events_url":"https://api.github.com/users/Tonkpils/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Tonkpils/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":true,"url":"https://api.github.com/repos/Tonkpils/active_merchant","forks_url":"https://api.github.com/repos/Tonkpils/active_merchant/forks","keys_url":"https://api.github.com/repos/Tonkpils/active_merchant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tonkpils/active_merchant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tonkpils/active_merchant/teams","hooks_url":"https://api.github.com/repos/Tonkpils/active_merchant/hooks","issue_events_url":"https://api.github.com/repos/Tonkpils/active_merchant/issues/events{/number}","events_url":"https://api.github.com/repos/Tonkpils/active_merchant/events","assignees_url":"https://api.github.com/repos/Tonkpils/active_merchant/assignees{/user}","branches_url":"https://api.github.com/repos/Tonkpils/active_merchant/branches{/branch}","tags_url":"https://api.github.com/repos/Tonkpils/active_merchant/tags","blobs_url":"https://api.github.com/repos/Tonkpils/active_merchant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tonkpils/active_merchant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tonkpils/active_merchant/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tonkpils/active_merchant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tonkpils/active_merchant/statuses/{sha}","languages_url":"https://api.github.com/repos/Tonkpils/active_merchant/languages","stargazers_url":"https://api.github.com/repos/Tonkpils/active_merchant/stargazers","contributors_url":"https://api.github.com/repos/Tonkpils/active_merchant/contributors","subscribers_url":"https://api.github.com/repos/Tonkpils/active_merchant/subscribers","subscription_url":"https://api.github.com/repos/Tonkpils/active_merchant/subscription","commits_url":"https://api.github.com/repos/Tonkpils/active_merchant/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tonkpils/active_merchant/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tonkpils/active_merchant/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tonkpils/active_merchant/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tonkpils/active_merchant/contents/{+path}","compare_url":"https://api.github.com/repos/Tonkpils/active_merchant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tonkpils/active_merchant/merges","archive_url":"https://api.github.com/repos/Tonkpils/active_merchant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tonkpils/active_merchant/downloads","issues_url":"https://api.github.com/repos/Tonkpils/active_merchant/issues{/number}","pulls_url":"https://api.github.com/repos/Tonkpils/active_merchant/pulls{/number}","milestones_url":"https://api.github.com/repos/Tonkpils/active_merchant/milestones{/number}","notifications_url":"https://api.github.com/repos/Tonkpils/active_merchant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tonkpils/active_merchant/labels{/name}","releases_url":"https://api.github.com/repos/Tonkpils/active_merchant/releases{/id}","deployments_url":"https://api.github.com/repos/Tonkpils/active_merchant/deployments","created_at":"2016-09-15T17:02:51Z","updated_at":"2016-09-15T17:02:55Z","pushed_at":"2016-11-06T09:59:58Z","git_url":"git://github.com/Tonkpils/active_merchant.git","ssh_url":"git@github.com:Tonkpils/active_merchant.git","clone_url":"https://github.com/Tonkpils/active_merchant.git","svn_url":"https://github.com/Tonkpils/active_merchant","homepage":"http://activemerchant.org","size":14262,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"activemerchant:master","ref":"master","sha":"a514d04825bbce0390b0b7ab4482293b5029d3ea","user":{"login":"activemerchant","id":12955944,"avatar_url":"https://avatars.githubusercontent.com/u/12955944?v=3","gravatar_id":"","url":"https://api.github.com/users/activemerchant","html_url":"https://github.com/activemerchant","followers_url":"https://api.github.com/users/activemerchant/followers","following_url":"https://api.github.com/users/activemerchant/following{/other_user}","gists_url":"https://api.github.com/users/activemerchant/gists{/gist_id}","starred_url":"https://api.github.com/users/activemerchant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activemerchant/subscriptions","organizations_url":"https://api.github.com/users/activemerchant/orgs","repos_url":"https://api.github.com/users/activemerchant/repos","events_url":"https://api.github.com/users/activemerchant/events{/privacy}","received_events_url":"https://api.github.com/users/activemerchant/received_events","type":"Organization","site_admin":false},"repo":{"id":18294,"name":"active_merchant","full_name":"activemerchant/active_merchant","owner":{"login":"activemerchant","id":12955944,"avatar_url":"https://avatars.githubusercontent.com/u/12955944?v=3","gravatar_id":"","url":"https://api.github.com/users/activemerchant","html_url":"https://github.com/activemerchant","followers_url":"https://api.github.com/users/activemerchant/followers","following_url":"https://api.github.com/users/activemerchant/following{/other_user}","gists_url":"https://api.github.com/users/activemerchant/gists{/gist_id}","starred_url":"https://api.github.com/users/activemerchant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activemerchant/subscriptions","organizations_url":"https://api.github.com/users/activemerchant/orgs","repos_url":"https://api.github.com/users/activemerchant/repos","events_url":"https://api.github.com/users/activemerchant/events{/privacy}","received_events_url":"https://api.github.com/users/activemerchant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/activemerchant/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/activemerchant/active_merchant","forks_url":"https://api.github.com/repos/activemerchant/active_merchant/forks","keys_url":"https://api.github.com/repos/activemerchant/active_merchant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/activemerchant/active_merchant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/activemerchant/active_merchant/teams","hooks_url":"https://api.github.com/repos/activemerchant/active_merchant/hooks","issue_events_url":"https://api.github.com/repos/activemerchant/active_merchant/issues/events{/number}","events_url":"https://api.github.com/repos/activemerchant/active_merchant/events","assignees_url":"https://api.github.com/repos/activemerchant/active_merchant/assignees{/user}","branches_url":"https://api.github.com/repos/activemerchant/active_merchant/branches{/branch}","tags_url":"https://api.github.com/repos/activemerchant/active_merchant/tags","blobs_url":"https://api.github.com/repos/activemerchant/active_merchant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/activemerchant/active_merchant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/activemerchant/active_merchant/git/refs{/sha}","trees_url":"https://api.github.com/repos/activemerchant/active_merchant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/activemerchant/active_merchant/statuses/{sha}","languages_url":"https://api.github.com/repos/activemerchant/active_merchant/languages","stargazers_url":"https://api.github.com/repos/activemerchant/active_merchant/stargazers","contributors_url":"https://api.github.com/repos/activemerchant/active_merchant/contributors","subscribers_url":"https://api.github.com/repos/activemerchant/active_merchant/subscribers","subscription_url":"https://api.github.com/repos/activemerchant/active_merchant/subscription","commits_url":"https://api.github.com/repos/activemerchant/active_merchant/commits{/sha}","git_commits_url":"https://api.github.com/repos/activemerchant/active_merchant/git/commits{/sha}","comments_url":"https://api.github.com/repos/activemerchant/active_merchant/comments{/number}","issue_comment_url":"https://api.github.com/repos/activemerchant/active_merchant/issues/comments{/number}","contents_url":"https://api.github.com/repos/activemerchant/active_merchant/contents/{+path}","compare_url":"https://api.github.com/repos/activemerchant/active_merchant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/activemerchant/active_merchant/merges","archive_url":"https://api.github.com/repos/activemerchant/active_merchant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/activemerchant/active_merchant/downloads","issues_url":"https://api.github.com/repos/activemerchant/active_merchant/issues{/number}","pulls_url":"https://api.github.com/repos/activemerchant/active_merchant/pulls{/number}","milestones_url":"https://api.github.com/repos/activemerchant/active_merchant/milestones{/number}","notifications_url":"https://api.github.com/repos/activemerchant/active_merchant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/activemerchant/active_merchant/labels{/name}","releases_url":"https://api.github.com/repos/activemerchant/active_merchant/releases{/id}","deployments_url":"https://api.github.com/repos/activemerchant/active_merchant/deployments","created_at":"2008-05-20T13:53:26Z","updated_at":"2016-11-05T22:35:14Z","pushed_at":"2016-11-06T09:00:02Z","git_url":"git://github.com/activemerchant/active_merchant.git","ssh_url":"git@github.com:activemerchant/active_merchant.git","clone_url":"https://github.com/activemerchant/active_merchant.git","svn_url":"https://github.com/activemerchant/active_merchant","homepage":"http://activemerchant.org","size":28193,"stargazers_count":3453,"watchers_count":3453,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1958,"mirror_url":null,"open_issues_count":126,"forks":1958,"open_issues":126,"watchers":3453,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/activemerchant/active_merchant/pulls/2243"},"html":{"href":"https://github.com/activemerchant/active_merchant/pull/2243"},"issue":{"href":"https://api.github.com/repos/activemerchant/active_merchant/issues/2243"},"comments":{"href":"https://api.github.com/repos/activemerchant/active_merchant/issues/2243/comments"},"review_comments":{"href":"https://api.github.com/repos/activemerchant/active_merchant/pulls/2243/comments"},"review_comment":{"href":"https://api.github.com/repos/activemerchant/active_merchant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/activemerchant/active_merchant/pulls/2243/commits"},"statuses":{"href":"https://api.github.com/repos/activemerchant/active_merchant/statuses/8b16e8ba3482566cc1c3497a995b4b9d6f36e7da"}}}}
{"actor":{"display_login":"houndci-bot"}}