{"action":"created","comment":{"url":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/comments/174791459","pull_request_review_id":104212310,"id":174791459,"diff_hunk":"@@ -0,0 +1,199 @@\n+<?php\n+/**\n+ * Shop System Plugins - Terms of Use\n+ *\n+ * The plugins offered are provided free of charge by Wirecard AG and are explicitly not part\n+ * of the Wirecard AG range of products and services.\n+ *\n+ * They have been tested and approved for full functionality in the standard configuration\n+ * (status on delivery) of the corresponding shop system. They are under General Public\n+ * License version 3 (GPLv3) and can be used, developed and passed on to third parties under\n+ * the same terms.\n+ *\n+ * However, Wirecard AG does not provide any guarantee or accept any liability for any errors\n+ * occurring when used in an enhanced, customized shop system configuration.\n+ *\n+ * Operation in an enhanced, customized configuration is at your own risk and requires a\n+ * comprehensive test phase by the user of the plugin.\n+ *\n+ * Customers use the plugins at their own risk. Wirecard AG does not guarantee their full\n+ * functionality neither does Wirecard AG assume liability for any disadvantages related to\n+ * the use of the plugins. Additionally, Wirecard AG does not guarantee the full functionality\n+ * for customized shop systems or installed plugins of other vendors of plugins within the same\n+ * shop system.\n+ *\n+ * Customers are responsible for testing the plugin's functionality before starting productive\n+ * operation.\n+ *\n+ * By installing the plugin into the shop system the customer agrees to these terms of use.\n+ * Please do not use the plugin if you do not agree to these terms of use!\n+ */\n+\n+require_once _WPC_MODULE_DIR_ . '/libraries/Logger.php';\n+require_once _WPC_MODULE_DIR_.'/vendor/autoload.php';\n+use Wirecard\\PaymentSdk\\Response\\SuccessResponse;\n+use Wirecard\\PaymentSdk\\Response\\FailureResponse;\n+use Wirecard\\PaymentSdk\\TransactionService;\n+\n+trait ResponseHandlerServiceTrait\n+{\n+\n+    protected $logger;\n+\n+    public function responseWirecardHandler($response, $context, $module)\n+    {\n+        $errors='';\n+        $message='';\n+        $orderId = (\n+            Tools::getValue(\"id_order\") == false) ? (int) $module->currentOrder : (int) Tools::getValue(\"id_order\") ;\n+        try {\n+            if ($response->isValidSignature()) {\n+                if ($response instanceof SuccessResponse) {\n+                    $this->successfulResponse($response, $context, $module);\n+                } elseif ($response instanceof FailureResponse) {\n+                    $this->failResponse($response, $context, $module);\n+                }\n+            } else {\n+                $this->cancelOrder(Tools::getValue('id_order'));\n+            }\n+\n+            $messageTemp = implode(',', $errors);\n+            if (Tools::strlen($messageTemp)) {\n+                $message = $messageTemp;\n+            }\n+        } catch (Exception $e) {\n+            $message = $e->getMessage();\n+        }\n+\n+        if ($message!='') {\n+            $this->context->cookie->eeMessage = $message;\n+        }\n+        Tools::redirectLink(\n+            __PS_BASE_URI__ . 'index.php?controller=order-detail&id_module='. $module->id .'&id_order=' . $orderId\n+        );\n+    }\n+\n+\n+    /**\n+     * @param $response\n+     * @param $context\n+     * @param $module\n+     */\n+    public function successfulResponse($response, $context, $module)\n+    {\n+        $customer = $context->customer;\n+        $this->logResponseStatuses($response);\n+        $responseArray = $response->getData();\n+        $orderId = (\n+            Tools::getValue(\"id_order\") == false) ?","path":"wirecardpaymentgateway/service/traits/ResponseHandlerServiceTrait.php","position":88,"original_position":88,"commit_id":"c62ff038e57c58a05e428c1913ba71649ec18b19","original_commit_id":"c62ff038e57c58a05e428c1913ba71649ec18b19","user":{"login":"wirecard-bot","id":19989513,"avatar_url":"https://avatars1.githubusercontent.com/u/19989513?v=4","gravatar_id":"","url":"https://api.github.com/users/wirecard-bot","html_url":"https://github.com/wirecard-bot","followers_url":"https://api.github.com/users/wirecard-bot/followers","following_url":"https://api.github.com/users/wirecard-bot/following{/other_user}","gists_url":"https://api.github.com/users/wirecard-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/wirecard-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wirecard-bot/subscriptions","organizations_url":"https://api.github.com/users/wirecard-bot/orgs","repos_url":"https://api.github.com/users/wirecard-bot/repos","events_url":"https://api.github.com/users/wirecard-bot/events{/privacy}","received_events_url":"https://api.github.com/users/wirecard-bot/received_events","type":"User","site_admin":false},"body":"![MINOR](https://sonarsource.github.io/sonar-github/severity-minor.png 'Severity: MINOR') Remove the literal \"false\" boolean value. [![rule](https://sonarsource.github.io/sonar-github/rule.png)](https://sonarcloud.io/coding_rules#rule_key=php%3AS1125)\n","created_at":"2018-03-15T14:01:16Z","updated_at":"2018-03-15T14:01:17Z","html_url":"https://github.com/wirecard/prestashop-ee/pull/35#discussion_r174791459","pull_request_url":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/35","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/comments/174791459"},"html":{"href":"https://github.com/wirecard/prestashop-ee/pull/35#discussion_r174791459"},"pull_request":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/35","id":171255297,"html_url":"https://github.com/wirecard/prestashop-ee/pull/35","diff_url":"https://github.com/wirecard/prestashop-ee/pull/35.diff","patch_url":"https://github.com/wirecard/prestashop-ee/pull/35.patch","issue_url":"https://api.github.com/repos/wirecard/prestashop-ee/issues/35","number":35,"state":"open","locked":false,"title":"#34 Refactored Code to move out of controller","user":{"login":"just-in-m","id":35484291,"avatar_url":"https://avatars3.githubusercontent.com/u/35484291?v=4","gravatar_id":"","url":"https://api.github.com/users/just-in-m","html_url":"https://github.com/just-in-m","followers_url":"https://api.github.com/users/just-in-m/followers","following_url":"https://api.github.com/users/just-in-m/following{/other_user}","gists_url":"https://api.github.com/users/just-in-m/gists{/gist_id}","starred_url":"https://api.github.com/users/just-in-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/just-in-m/subscriptions","organizations_url":"https://api.github.com/users/just-in-m/orgs","repos_url":"https://api.github.com/users/just-in-m/repos","events_url":"https://api.github.com/users/just-in-m/events{/privacy}","received_events_url":"https://api.github.com/users/just-in-m/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-25T22:25:33Z","updated_at":"2018-03-15T14:01:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db65b21c09da4280533e8f0da4205a8db45b2025","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/35/commits","review_comments_url":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/35/comments","review_comment_url":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wirecard/prestashop-ee/issues/35/comments","statuses_url":"https://api.github.com/repos/wirecard/prestashop-ee/statuses/c62ff038e57c58a05e428c1913ba71649ec18b19","head":{"label":"wirecard:paypal-creditcard-sepa","ref":"paypal-creditcard-sepa","sha":"c62ff038e57c58a05e428c1913ba71649ec18b19","user":{"login":"wirecard","id":15652686,"avatar_url":"https://avatars3.githubusercontent.com/u/15652686?v=4","gravatar_id":"","url":"https://api.github.com/users/wirecard","html_url":"https://github.com/wirecard","followers_url":"https://api.github.com/users/wirecard/followers","following_url":"https://api.github.com/users/wirecard/following{/other_user}","gists_url":"https://api.github.com/users/wirecard/gists{/gist_id}","starred_url":"https://api.github.com/users/wirecard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wirecard/subscriptions","organizations_url":"https://api.github.com/users/wirecard/orgs","repos_url":"https://api.github.com/users/wirecard/repos","events_url":"https://api.github.com/users/wirecard/events{/privacy}","received_events_url":"https://api.github.com/users/wirecard/received_events","type":"Organization","site_admin":false},"repo":{"id":117562792,"name":"prestashop-ee","full_name":"wirecard/prestashop-ee","owner":{"login":"wirecard","id":15652686,"avatar_url":"https://avatars3.githubusercontent.com/u/15652686?v=4","gravatar_id":"","url":"https://api.github.com/users/wirecard","html_url":"https://github.com/wirecard","followers_url":"https://api.github.com/users/wirecard/followers","following_url":"https://api.github.com/users/wirecard/following{/other_user}","gists_url":"https://api.github.com/users/wirecard/gists{/gist_id}","starred_url":"https://api.github.com/users/wirecard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wirecard/subscriptions","organizations_url":"https://api.github.com/users/wirecard/orgs","repos_url":"https://api.github.com/users/wirecard/repos","events_url":"https://api.github.com/users/wirecard/events{/privacy}","received_events_url":"https://api.github.com/users/wirecard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wirecard/prestashop-ee","description":null,"fork":false,"url":"https://api.github.com/repos/wirecard/prestashop-ee","forks_url":"https://api.github.com/repos/wirecard/prestashop-ee/forks","keys_url":"https://api.github.com/repos/wirecard/prestashop-ee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wirecard/prestashop-ee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wirecard/prestashop-ee/teams","hooks_url":"https://api.github.com/repos/wirecard/prestashop-ee/hooks","issue_events_url":"https://api.github.com/repos/wirecard/prestashop-ee/issues/events{/number}","events_url":"https://api.github.com/repos/wirecard/prestashop-ee/events","assignees_url":"https://api.github.com/repos/wirecard/prestashop-ee/assignees{/user}","branches_url":"https://api.github.com/repos/wirecard/prestashop-ee/branches{/branch}","tags_url":"https://api.github.com/repos/wirecard/prestashop-ee/tags","blobs_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/refs{/sha}","trees_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wirecard/prestashop-ee/statuses/{sha}","languages_url":"https://api.github.com/repos/wirecard/prestashop-ee/languages","stargazers_url":"https://api.github.com/repos/wirecard/prestashop-ee/stargazers","contributors_url":"https://api.github.com/repos/wirecard/prestashop-ee/contributors","subscribers_url":"https://api.github.com/repos/wirecard/prestashop-ee/subscribers","subscription_url":"https://api.github.com/repos/wirecard/prestashop-ee/subscription","commits_url":"https://api.github.com/repos/wirecard/prestashop-ee/commits{/sha}","git_commits_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/commits{/sha}","comments_url":"https://api.github.com/repos/wirecard/prestashop-ee/comments{/number}","issue_comment_url":"https://api.github.com/repos/wirecard/prestashop-ee/issues/comments{/number}","contents_url":"https://api.github.com/repos/wirecard/prestashop-ee/contents/{+path}","compare_url":"https://api.github.com/repos/wirecard/prestashop-ee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wirecard/prestashop-ee/merges","archive_url":"https://api.github.com/repos/wirecard/prestashop-ee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wirecard/prestashop-ee/downloads","issues_url":"https://api.github.com/repos/wirecard/prestashop-ee/issues{/number}","pulls_url":"https://api.github.com/repos/wirecard/prestashop-ee/pulls{/number}","milestones_url":"https://api.github.com/repos/wirecard/prestashop-ee/milestones{/number}","notifications_url":"https://api.github.com/repos/wirecard/prestashop-ee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wirecard/prestashop-ee/labels{/name}","releases_url":"https://api.github.com/repos/wirecard/prestashop-ee/releases{/id}","deployments_url":"https://api.github.com/repos/wirecard/prestashop-ee/deployments","created_at":"2018-01-15T15:32:09Z","updated_at":"2018-02-01T09:10:50Z","pushed_at":"2018-03-15T13:59:25Z","git_url":"git://github.com/wirecard/prestashop-ee.git","ssh_url":"git@github.com:wirecard/prestashop-ee.git","clone_url":"https://github.com/wirecard/prestashop-ee.git","svn_url":"https://github.com/wirecard/prestashop-ee","homepage":null,"size":4401,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"wirecard:master","ref":"master","sha":"6c575742e218b5c1dcb7786c25f51e7990c95fb9","user":{"login":"wirecard","id":15652686,"avatar_url":"https://avatars3.githubusercontent.com/u/15652686?v=4","gravatar_id":"","url":"https://api.github.com/users/wirecard","html_url":"https://github.com/wirecard","followers_url":"https://api.github.com/users/wirecard/followers","following_url":"https://api.github.com/users/wirecard/following{/other_user}","gists_url":"https://api.github.com/users/wirecard/gists{/gist_id}","starred_url":"https://api.github.com/users/wirecard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wirecard/subscriptions","organizations_url":"https://api.github.com/users/wirecard/orgs","repos_url":"https://api.github.com/users/wirecard/repos","events_url":"https://api.github.com/users/wirecard/events{/privacy}","received_events_url":"https://api.github.com/users/wirecard/received_events","type":"Organization","site_admin":false},"repo":{"id":117562792,"name":"prestashop-ee","full_name":"wirecard/prestashop-ee","owner":{"login":"wirecard","id":15652686,"avatar_url":"https://avatars3.githubusercontent.com/u/15652686?v=4","gravatar_id":"","url":"https://api.github.com/users/wirecard","html_url":"https://github.com/wirecard","followers_url":"https://api.github.com/users/wirecard/followers","following_url":"https://api.github.com/users/wirecard/following{/other_user}","gists_url":"https://api.github.com/users/wirecard/gists{/gist_id}","starred_url":"https://api.github.com/users/wirecard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wirecard/subscriptions","organizations_url":"https://api.github.com/users/wirecard/orgs","repos_url":"https://api.github.com/users/wirecard/repos","events_url":"https://api.github.com/users/wirecard/events{/privacy}","received_events_url":"https://api.github.com/users/wirecard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wirecard/prestashop-ee","description":null,"fork":false,"url":"https://api.github.com/repos/wirecard/prestashop-ee","forks_url":"https://api.github.com/repos/wirecard/prestashop-ee/forks","keys_url":"https://api.github.com/repos/wirecard/prestashop-ee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wirecard/prestashop-ee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wirecard/prestashop-ee/teams","hooks_url":"https://api.github.com/repos/wirecard/prestashop-ee/hooks","issue_events_url":"https://api.github.com/repos/wirecard/prestashop-ee/issues/events{/number}","events_url":"https://api.github.com/repos/wirecard/prestashop-ee/events","assignees_url":"https://api.github.com/repos/wirecard/prestashop-ee/assignees{/user}","branches_url":"https://api.github.com/repos/wirecard/prestashop-ee/branches{/branch}","tags_url":"https://api.github.com/repos/wirecard/prestashop-ee/tags","blobs_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/refs{/sha}","trees_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wirecard/prestashop-ee/statuses/{sha}","languages_url":"https://api.github.com/repos/wirecard/prestashop-ee/languages","stargazers_url":"https://api.github.com/repos/wirecard/prestashop-ee/stargazers","contributors_url":"https://api.github.com/repos/wirecard/prestashop-ee/contributors","subscribers_url":"https://api.github.com/repos/wirecard/prestashop-ee/subscribers","subscription_url":"https://api.github.com/repos/wirecard/prestashop-ee/subscription","commits_url":"https://api.github.com/repos/wirecard/prestashop-ee/commits{/sha}","git_commits_url":"https://api.github.com/repos/wirecard/prestashop-ee/git/commits{/sha}","comments_url":"https://api.github.com/repos/wirecard/prestashop-ee/comments{/number}","issue_comment_url":"https://api.github.com/repos/wirecard/prestashop-ee/issues/comments{/number}","contents_url":"https://api.github.com/repos/wirecard/prestashop-ee/contents/{+path}","compare_url":"https://api.github.com/repos/wirecard/prestashop-ee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wirecard/prestashop-ee/merges","archive_url":"https://api.github.com/repos/wirecard/prestashop-ee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wirecard/prestashop-ee/downloads","issues_url":"https://api.github.com/repos/wirecard/prestashop-ee/issues{/number}","pulls_url":"https://api.github.com/repos/wirecard/prestashop-ee/pulls{/number}","milestones_url":"https://api.github.com/repos/wirecard/prestashop-ee/milestones{/number}","notifications_url":"https://api.github.com/repos/wirecard/prestashop-ee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wirecard/prestashop-ee/labels{/name}","releases_url":"https://api.github.com/repos/wirecard/prestashop-ee/releases{/id}","deployments_url":"https://api.github.com/repos/wirecard/prestashop-ee/deployments","created_at":"2018-01-15T15:32:09Z","updated_at":"2018-02-01T09:10:50Z","pushed_at":"2018-03-15T13:59:25Z","git_url":"git://github.com/wirecard/prestashop-ee.git","ssh_url":"git@github.com:wirecard/prestashop-ee.git","clone_url":"https://github.com/wirecard/prestashop-ee.git","svn_url":"https://github.com/wirecard/prestashop-ee","homepage":null,"size":4401,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/35"},"html":{"href":"https://github.com/wirecard/prestashop-ee/pull/35"},"issue":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/issues/35"},"comments":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/wirecard/prestashop-ee/statuses/c62ff038e57c58a05e428c1913ba71649ec18b19"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"wirecard-bot"}}