{"action":"created","comment":{"url":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/comments/236487530","pull_request_review_id":178571704,"id":236487530,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjQ4NzUzMA==","diff_hunk":"@@ -701,14 +688,60 @@ public function formatReferenceUrl($reference)\n     }\n \n     /**\n-     * Format the (class internal) unambiguous transaction state out of the type and status\n+     * Format the (class internal) unambiguous transaction state out of the type and status.\n+     * Infer eventually missing states. Represent Bolt partial capture AUTHORIZED state as CAPTURED.\n      *\n      * @param \\stdClass $transaction\n+     * @param OrderPaymentInterface $payment\n      * @return string\n      */\n-    public function getTransactionState($transaction)\n+    public function getTransactionState($transaction, $payment)\n     {\n-        return $transaction->type.\":\".$transaction->status;\n+        $transactionState = $transaction->type.\":\".$transaction->status;\n+        $prevTransactionState = $payment->getAdditionalInformation('transaction_state');\n+        $prevCaptures = $payment->getAdditionalInformation('captures') ?: [];\n+\n+        if (!$prevTransactionState) {\n+            if (in_array($transactionState, [self::TS_ZERO_AMOUNT, self::TS_CREDIT_COMPLETED])) {\n+                return $transactionState;\n+            }\n+            return self::TS_PENDING;\n+        }\n+\n+        if (in_array($prevTransactionState, [self::TS_PENDING, self::TS_REJECTED_REVERSIBLE]) &&\n+            $transactionState == self::TS_AUTHORIZED &&\n+            $transaction->captures\n+        ) {\n+            return self::TS_AUTHORIZED;","path":"Helper/Order.php","position":349,"original_position":349,"commit_id":"3f2764ee3d52110620f78dc6a28a79fa1ecb5e3c","original_commit_id":"3f2764ee3d52110620f78dc6a28a79fa1ecb5e3c","user":{"login":"daisy1754","id":980077,"node_id":"MDQ6VXNlcjk4MDA3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/980077?v=4","gravatar_id":"","url":"https://api.github.com/users/daisy1754","html_url":"https://github.com/daisy1754","followers_url":"https://api.github.com/users/daisy1754/followers","following_url":"https://api.github.com/users/daisy1754/following{/other_user}","gists_url":"https://api.github.com/users/daisy1754/gists{/gist_id}","starred_url":"https://api.github.com/users/daisy1754/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daisy1754/subscriptions","organizations_url":"https://api.github.com/users/daisy1754/orgs","repos_url":"https://api.github.com/users/daisy1754/repos","events_url":"https://api.github.com/users/daisy1754/events{/privacy}","received_events_url":"https://api.github.com/users/daisy1754/received_events","type":"User","site_admin":false},"body":"comment above says `Represent Bolt partial capture AUTHORIZED state as CAPTURED` but here you use `authorized`?","created_at":"2018-11-27T01:08:42Z","updated_at":"2018-11-27T01:18:12Z","html_url":"https://github.com/BoltApp/bolt-magento2/pull/152#discussion_r236487530","pull_request_url":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/152","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/comments/236487530"},"html":{"href":"https://github.com/BoltApp/bolt-magento2/pull/152#discussion_r236487530"},"pull_request":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/152"}}},"pull_request":{"url":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/152","id":233705343,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNzA1MzQz","html_url":"https://github.com/BoltApp/bolt-magento2/pull/152","diff_url":"https://github.com/BoltApp/bolt-magento2/pull/152.diff","patch_url":"https://github.com/BoltApp/bolt-magento2/pull/152.patch","issue_url":"https://api.github.com/repos/BoltApp/bolt-magento2/issues/152","number":152,"state":"open","locked":false,"title":"update partial capture, fix auto capture bug, update total mismatch c…","user":{"login":"danac-gs","id":37150717,"node_id":"MDQ6VXNlcjM3MTUwNzE3","avatar_url":"https://avatars1.githubusercontent.com/u/37150717?v=4","gravatar_id":"","url":"https://api.github.com/users/danac-gs","html_url":"https://github.com/danac-gs","followers_url":"https://api.github.com/users/danac-gs/followers","following_url":"https://api.github.com/users/danac-gs/following{/other_user}","gists_url":"https://api.github.com/users/danac-gs/gists{/gist_id}","starred_url":"https://api.github.com/users/danac-gs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danac-gs/subscriptions","organizations_url":"https://api.github.com/users/danac-gs/orgs","repos_url":"https://api.github.com/users/danac-gs/repos","events_url":"https://api.github.com/users/danac-gs/events{/privacy}","received_events_url":"https://api.github.com/users/danac-gs/received_events","type":"User","site_admin":false},"body":"…heck","created_at":"2018-11-26T21:39:33Z","updated_at":"2018-11-27T01:18:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e8af7e06ef231f16ba22a1ef4c0c8515f4aa774","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mccottry","id":973856,"node_id":"MDQ6VXNlcjk3Mzg1Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/973856?v=4","gravatar_id":"","url":"https://api.github.com/users/mccottry","html_url":"https://github.com/mccottry","followers_url":"https://api.github.com/users/mccottry/followers","following_url":"https://api.github.com/users/mccottry/following{/other_user}","gists_url":"https://api.github.com/users/mccottry/gists{/gist_id}","starred_url":"https://api.github.com/users/mccottry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mccottry/subscriptions","organizations_url":"https://api.github.com/users/mccottry/orgs","repos_url":"https://api.github.com/users/mccottry/repos","events_url":"https://api.github.com/users/mccottry/events{/privacy}","received_events_url":"https://api.github.com/users/mccottry/received_events","type":"User","site_admin":false},{"login":"johnmccombs1","id":2002287,"node_id":"MDQ6VXNlcjIwMDIyODc=","avatar_url":"https://avatars3.githubusercontent.com/u/2002287?v=4","gravatar_id":"","url":"https://api.github.com/users/johnmccombs1","html_url":"https://github.com/johnmccombs1","followers_url":"https://api.github.com/users/johnmccombs1/followers","following_url":"https://api.github.com/users/johnmccombs1/following{/other_user}","gists_url":"https://api.github.com/users/johnmccombs1/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmccombs1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmccombs1/subscriptions","organizations_url":"https://api.github.com/users/johnmccombs1/orgs","repos_url":"https://api.github.com/users/johnmccombs1/repos","events_url":"https://api.github.com/users/johnmccombs1/events{/privacy}","received_events_url":"https://api.github.com/users/johnmccombs1/received_events","type":"User","site_admin":false},{"login":"YevhenShBolt","id":38316221,"node_id":"MDQ6VXNlcjM4MzE2MjIx","avatar_url":"https://avatars0.githubusercontent.com/u/38316221?v=4","gravatar_id":"","url":"https://api.github.com/users/YevhenShBolt","html_url":"https://github.com/YevhenShBolt","followers_url":"https://api.github.com/users/YevhenShBolt/followers","following_url":"https://api.github.com/users/YevhenShBolt/following{/other_user}","gists_url":"https://api.github.com/users/YevhenShBolt/gists{/gist_id}","starred_url":"https://api.github.com/users/YevhenShBolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YevhenShBolt/subscriptions","organizations_url":"https://api.github.com/users/YevhenShBolt/orgs","repos_url":"https://api.github.com/users/YevhenShBolt/repos","events_url":"https://api.github.com/users/YevhenShBolt/events{/privacy}","received_events_url":"https://api.github.com/users/YevhenShBolt/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/152/commits","review_comments_url":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/152/comments","review_comment_url":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BoltApp/bolt-magento2/issues/152/comments","statuses_url":"https://api.github.com/repos/BoltApp/bolt-magento2/statuses/3f2764ee3d52110620f78dc6a28a79fa1ecb5e3c","head":{"label":"BoltApp:autocapture-totals-update-fix","ref":"autocapture-totals-update-fix","sha":"3f2764ee3d52110620f78dc6a28a79fa1ecb5e3c","user":{"login":"BoltApp","id":8142070,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxNDIwNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/8142070?v=4","gravatar_id":"","url":"https://api.github.com/users/BoltApp","html_url":"https://github.com/BoltApp","followers_url":"https://api.github.com/users/BoltApp/followers","following_url":"https://api.github.com/users/BoltApp/following{/other_user}","gists_url":"https://api.github.com/users/BoltApp/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltApp/subscriptions","organizations_url":"https://api.github.com/users/BoltApp/orgs","repos_url":"https://api.github.com/users/BoltApp/repos","events_url":"https://api.github.com/users/BoltApp/events{/privacy}","received_events_url":"https://api.github.com/users/BoltApp/received_events","type":"Organization","site_admin":false},"repo":{"id":125257411,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUyNTc0MTE=","name":"bolt-magento2","full_name":"BoltApp/bolt-magento2","private":false,"owner":{"login":"BoltApp","id":8142070,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxNDIwNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/8142070?v=4","gravatar_id":"","url":"https://api.github.com/users/BoltApp","html_url":"https://github.com/BoltApp","followers_url":"https://api.github.com/users/BoltApp/followers","following_url":"https://api.github.com/users/BoltApp/following{/other_user}","gists_url":"https://api.github.com/users/BoltApp/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltApp/subscriptions","organizations_url":"https://api.github.com/users/BoltApp/orgs","repos_url":"https://api.github.com/users/BoltApp/repos","events_url":"https://api.github.com/users/BoltApp/events{/privacy}","received_events_url":"https://api.github.com/users/BoltApp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/BoltApp/bolt-magento2","description":"Bolt plugin for magento2","fork":false,"url":"https://api.github.com/repos/BoltApp/bolt-magento2","forks_url":"https://api.github.com/repos/BoltApp/bolt-magento2/forks","keys_url":"https://api.github.com/repos/BoltApp/bolt-magento2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BoltApp/bolt-magento2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BoltApp/bolt-magento2/teams","hooks_url":"https://api.github.com/repos/BoltApp/bolt-magento2/hooks","issue_events_url":"https://api.github.com/repos/BoltApp/bolt-magento2/issues/events{/number}","events_url":"https://api.github.com/repos/BoltApp/bolt-magento2/events","assignees_url":"https://api.github.com/repos/BoltApp/bolt-magento2/assignees{/user}","branches_url":"https://api.github.com/repos/BoltApp/bolt-magento2/branches{/branch}","tags_url":"https://api.github.com/repos/BoltApp/bolt-magento2/tags","blobs_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/refs{/sha}","trees_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BoltApp/bolt-magento2/statuses/{sha}","languages_url":"https://api.github.com/repos/BoltApp/bolt-magento2/languages","stargazers_url":"https://api.github.com/repos/BoltApp/bolt-magento2/stargazers","contributors_url":"https://api.github.com/repos/BoltApp/bolt-magento2/contributors","subscribers_url":"https://api.github.com/repos/BoltApp/bolt-magento2/subscribers","subscription_url":"https://api.github.com/repos/BoltApp/bolt-magento2/subscription","commits_url":"https://api.github.com/repos/BoltApp/bolt-magento2/commits{/sha}","git_commits_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/commits{/sha}","comments_url":"https://api.github.com/repos/BoltApp/bolt-magento2/comments{/number}","issue_comment_url":"https://api.github.com/repos/BoltApp/bolt-magento2/issues/comments{/number}","contents_url":"https://api.github.com/repos/BoltApp/bolt-magento2/contents/{+path}","compare_url":"https://api.github.com/repos/BoltApp/bolt-magento2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BoltApp/bolt-magento2/merges","archive_url":"https://api.github.com/repos/BoltApp/bolt-magento2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BoltApp/bolt-magento2/downloads","issues_url":"https://api.github.com/repos/BoltApp/bolt-magento2/issues{/number}","pulls_url":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls{/number}","milestones_url":"https://api.github.com/repos/BoltApp/bolt-magento2/milestones{/number}","notifications_url":"https://api.github.com/repos/BoltApp/bolt-magento2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BoltApp/bolt-magento2/labels{/name}","releases_url":"https://api.github.com/repos/BoltApp/bolt-magento2/releases{/id}","deployments_url":"https://api.github.com/repos/BoltApp/bolt-magento2/deployments","created_at":"2018-03-14T18:34:24Z","updated_at":"2018-11-21T13:33:02Z","pushed_at":"2018-11-26T21:39:33Z","git_url":"git://github.com/BoltApp/bolt-magento2.git","ssh_url":"git@github.com:BoltApp/bolt-magento2.git","clone_url":"https://github.com/BoltApp/bolt-magento2.git","svn_url":"https://github.com/BoltApp/bolt-magento2","homepage":null,"size":899,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"osl-3.0","name":"Open Software License 3.0","spdx_id":"OSL-3.0","url":"https://api.github.com/licenses/osl-3.0","node_id":"MDc6TGljZW5zZTE2"},"forks":4,"open_issues":2,"watchers":2,"default_branch":"develop"}},"base":{"label":"BoltApp:develop","ref":"develop","sha":"42ecc7d1cf7b91f896256943de7fac8f51b79849","user":{"login":"BoltApp","id":8142070,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxNDIwNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/8142070?v=4","gravatar_id":"","url":"https://api.github.com/users/BoltApp","html_url":"https://github.com/BoltApp","followers_url":"https://api.github.com/users/BoltApp/followers","following_url":"https://api.github.com/users/BoltApp/following{/other_user}","gists_url":"https://api.github.com/users/BoltApp/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltApp/subscriptions","organizations_url":"https://api.github.com/users/BoltApp/orgs","repos_url":"https://api.github.com/users/BoltApp/repos","events_url":"https://api.github.com/users/BoltApp/events{/privacy}","received_events_url":"https://api.github.com/users/BoltApp/received_events","type":"Organization","site_admin":false},"repo":{"id":125257411,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUyNTc0MTE=","name":"bolt-magento2","full_name":"BoltApp/bolt-magento2","private":false,"owner":{"login":"BoltApp","id":8142070,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxNDIwNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/8142070?v=4","gravatar_id":"","url":"https://api.github.com/users/BoltApp","html_url":"https://github.com/BoltApp","followers_url":"https://api.github.com/users/BoltApp/followers","following_url":"https://api.github.com/users/BoltApp/following{/other_user}","gists_url":"https://api.github.com/users/BoltApp/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltApp/subscriptions","organizations_url":"https://api.github.com/users/BoltApp/orgs","repos_url":"https://api.github.com/users/BoltApp/repos","events_url":"https://api.github.com/users/BoltApp/events{/privacy}","received_events_url":"https://api.github.com/users/BoltApp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/BoltApp/bolt-magento2","description":"Bolt plugin for magento2","fork":false,"url":"https://api.github.com/repos/BoltApp/bolt-magento2","forks_url":"https://api.github.com/repos/BoltApp/bolt-magento2/forks","keys_url":"https://api.github.com/repos/BoltApp/bolt-magento2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BoltApp/bolt-magento2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BoltApp/bolt-magento2/teams","hooks_url":"https://api.github.com/repos/BoltApp/bolt-magento2/hooks","issue_events_url":"https://api.github.com/repos/BoltApp/bolt-magento2/issues/events{/number}","events_url":"https://api.github.com/repos/BoltApp/bolt-magento2/events","assignees_url":"https://api.github.com/repos/BoltApp/bolt-magento2/assignees{/user}","branches_url":"https://api.github.com/repos/BoltApp/bolt-magento2/branches{/branch}","tags_url":"https://api.github.com/repos/BoltApp/bolt-magento2/tags","blobs_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/refs{/sha}","trees_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BoltApp/bolt-magento2/statuses/{sha}","languages_url":"https://api.github.com/repos/BoltApp/bolt-magento2/languages","stargazers_url":"https://api.github.com/repos/BoltApp/bolt-magento2/stargazers","contributors_url":"https://api.github.com/repos/BoltApp/bolt-magento2/contributors","subscribers_url":"https://api.github.com/repos/BoltApp/bolt-magento2/subscribers","subscription_url":"https://api.github.com/repos/BoltApp/bolt-magento2/subscription","commits_url":"https://api.github.com/repos/BoltApp/bolt-magento2/commits{/sha}","git_commits_url":"https://api.github.com/repos/BoltApp/bolt-magento2/git/commits{/sha}","comments_url":"https://api.github.com/repos/BoltApp/bolt-magento2/comments{/number}","issue_comment_url":"https://api.github.com/repos/BoltApp/bolt-magento2/issues/comments{/number}","contents_url":"https://api.github.com/repos/BoltApp/bolt-magento2/contents/{+path}","compare_url":"https://api.github.com/repos/BoltApp/bolt-magento2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BoltApp/bolt-magento2/merges","archive_url":"https://api.github.com/repos/BoltApp/bolt-magento2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BoltApp/bolt-magento2/downloads","issues_url":"https://api.github.com/repos/BoltApp/bolt-magento2/issues{/number}","pulls_url":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls{/number}","milestones_url":"https://api.github.com/repos/BoltApp/bolt-magento2/milestones{/number}","notifications_url":"https://api.github.com/repos/BoltApp/bolt-magento2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BoltApp/bolt-magento2/labels{/name}","releases_url":"https://api.github.com/repos/BoltApp/bolt-magento2/releases{/id}","deployments_url":"https://api.github.com/repos/BoltApp/bolt-magento2/deployments","created_at":"2018-03-14T18:34:24Z","updated_at":"2018-11-21T13:33:02Z","pushed_at":"2018-11-26T21:39:33Z","git_url":"git://github.com/BoltApp/bolt-magento2.git","ssh_url":"git@github.com:BoltApp/bolt-magento2.git","clone_url":"https://github.com/BoltApp/bolt-magento2.git","svn_url":"https://github.com/BoltApp/bolt-magento2","homepage":null,"size":899,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"osl-3.0","name":"Open Software License 3.0","spdx_id":"OSL-3.0","url":"https://api.github.com/licenses/osl-3.0","node_id":"MDc6TGljZW5zZTE2"},"forks":4,"open_issues":2,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/152"},"html":{"href":"https://github.com/BoltApp/bolt-magento2/pull/152"},"issue":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/issues/152"},"comments":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/issues/152/comments"},"review_comments":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/152/comments"},"review_comment":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/pulls/152/commits"},"statuses":{"href":"https://api.github.com/repos/BoltApp/bolt-magento2/statuses/3f2764ee3d52110620f78dc6a28a79fa1ecb5e3c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"daisy1754"}}