{"action":"created","comment":{"url":"https://api.github.com/repos/omise/omise-eccube/pulls/comments/65278877","id":65278877,"diff_hunk":"@@ -0,0 +1,271 @@\n+<?php\n+/**\n+ * This file is part of EC-CUBE Plugin OmiseExt\n+ *\n+ * @copyright 2016 Omise All Rights Reserved.\n+ * @author Akira Narita\n+ *\n+ */\n+\n+/**\n+ * Omise charge handler\n+ *\n+ * @author Akira / Omise\n+ */\n+class Omise_Models_Charge\n+{\n+    /**\n+     * @var $arrOrder テーブルからロードした order のデータ\n+     */\n+    public $arrOrder;\n+\n+    public function __construct($order_id)\n+    {\n+        $objPurchase    = new SC_Helper_Purchase_Ex();\n+        $this->arrOrder = $objPurchase->getOrder($order_id);\n+    }\n+\n+    /**\n+     * Sync Omise Charge data and local data on ECCUBE db\n+     */\n+    public function syncOmise()\n+    {\n+        $objCharge   = OmiseWrapper::chargeRetrieve(self::getChargeId());\n+        $objPurchase = new SC_Helper_Purchase_Ex();\n+        $updateData  = array(OMISE_MDL_CHARGE_DATA_COL => $this->lfConvertToDbChargeData($objCharge));\n+        $objQuery    = SC_Query_Ex::getSingletonInstance();\n+        $objQuery->begin();\n+        $objPurchase->sfUpdateOrderStatus(\n+            $this->arrOrder['order_id'],\n+            null, // 対応状況 ＊nullは変更なし\n+            null, // 加算ポイント ＊nullは変更なし\n+            null, // 使用ポイント ＊nullは変更なし\n+            $updateData\n+        );\n+        $objQuery->commit();\n+        $order_id = $this->arrOrder['order_id'];\n+        $this->arrOrder = $objPurchase->getOrder($order_id);\n+    }\n+\n+    /**\n+     * Get Omise Charge id\n+     * @return string Omise Charge id string\n+     */\n+    public function getChargeId()\n+    {\n+        $arrData = $this->lfGetChargeData();\n+        return $arrData['id'];\n+    }\n+\n+    /**\n+     * Return true if refunded\n+     * @return boolean\n+     */\n+    public function isRefunded()\n+    {\n+        $arrData = $this->lfGetChargeData();\n+        return ($arrData['real_amount'] == 0) ? true : false;\n+    }\n+\n+    /**\n+     * Return true if livemode\n+     * @return boolean\n+     */\n+    public function isLiveCharge()\n+    {\n+        $arrData = $this->lfGetChargeData();\n+        return $arrData['livemode'];\n+    }\n+\n+    /**\n+     * Get the Omise Charge detail page url string\n+     * @return string The Omise Charge detail page\n+     */\n+    public function getOmisePage()\n+    {\n+        return sprintf('https://dashboard.omise.co/%s/charges/%s',\n+            $this->isLiveCharge() ? 'live' : 'test',\n+            $this->getChargeId());\n+    }\n+\n+    /**\n+     * Return true if the Omise Charge was captured\n+     * @return boolean\n+     */\n+    public function isCaptured()\n+    {\n+        $arrData = $this->lfGetChargeData();\n+        return ($arrData['captured'] == 1) ? true : false;","path":"2.13.3/OmiseExt/class/models/Omise_Models_Charge.php","position":98,"original_position":98,"commit_id":"4a3d33d65a617c41bf073d359decd310e5b3bf8b","original_commit_id":"4a3d33d65a617c41bf073d359decd310e5b3bf8b","user":{"login":"guzzilar","id":2154669,"avatar_url":"https://avatars.githubusercontent.com/u/2154669?v=3","gravatar_id":"","url":"https://api.github.com/users/guzzilar","html_url":"https://github.com/guzzilar","followers_url":"https://api.github.com/users/guzzilar/followers","following_url":"https://api.github.com/users/guzzilar/following{/other_user}","gists_url":"https://api.github.com/users/guzzilar/gists{/gist_id}","starred_url":"https://api.github.com/users/guzzilar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guzzilar/subscriptions","organizations_url":"https://api.github.com/users/guzzilar/orgs","repos_url":"https://api.github.com/users/guzzilar/repos","events_url":"https://api.github.com/users/guzzilar/events{/privacy}","received_events_url":"https://api.github.com/users/guzzilar/received_events","type":"User","site_admin":false},"body":"aha, maybe... it came from this line? https://github.com/omise/omise-eccube/pull/5/files#diff-5662b5fa5aef8d71625167a645616ce1R201 (I saw you converted `paid` to `captured` there)","created_at":"2016-05-31T23:11:45Z","updated_at":"2016-05-31T23:11:45Z","html_url":"https://github.com/omise/omise-eccube/pull/5#discussion_r65278877","pull_request_url":"https://api.github.com/repos/omise/omise-eccube/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/omise/omise-eccube/pulls/comments/65278877"},"html":{"href":"https://github.com/omise/omise-eccube/pull/5#discussion_r65278877"},"pull_request":{"href":"https://api.github.com/repos/omise/omise-eccube/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/omise/omise-eccube/pulls/5","id":67472308,"html_url":"https://github.com/omise/omise-eccube/pull/5","diff_url":"https://github.com/omise/omise-eccube/pull/5.diff","patch_url":"https://github.com/omise/omise-eccube/pull/5.patch","issue_url":"https://api.github.com/repos/omise/omise-eccube/issues/5","number":5,"state":"open","locked":false,"title":"Add OmiseExt ECCUBE 2.13.3 plugin","user":{"login":"akinrt","id":5040538,"avatar_url":"https://avatars.githubusercontent.com/u/5040538?v=3","gravatar_id":"","url":"https://api.github.com/users/akinrt","html_url":"https://github.com/akinrt","followers_url":"https://api.github.com/users/akinrt/followers","following_url":"https://api.github.com/users/akinrt/following{/other_user}","gists_url":"https://api.github.com/users/akinrt/gists{/gist_id}","starred_url":"https://api.github.com/users/akinrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akinrt/subscriptions","organizations_url":"https://api.github.com/users/akinrt/orgs","repos_url":"https://api.github.com/users/akinrt/repos","events_url":"https://api.github.com/users/akinrt/events{/privacy}","received_events_url":"https://api.github.com/users/akinrt/received_events","type":"User","site_admin":false},"body":"Initial Omise EC-CUBE 2.13.3 plugin named `OmiseExt` .\r\nThis plugin is designed for Japanese EC-CUBE2.13.3 users who want to use Omise on the best way with EC-CUBE.\r\n\r\n- Add initial OmiseExt to `2.13.3/OmiseExt/`\r\n- Write installation Japanese document on `2.13.3/README` .\r\n\r\n**Notes.**\r\n\r\n- `2.13.3/OmiseExt/` use git-submodule to use [omise-php v2.4.1](https://github.com/omise/omise-php/releases/tag/v2.4.1)\r\n- Installation detail is written in `2.13.3/README` .\r\n- The previous version which @adnaoki developed is totally unnecessary, sorry to tell about this, but we appreciate how hard @adnaoki works.","created_at":"2016-04-22T07:53:55Z","updated_at":"2016-05-31T23:11:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e70a8c24ea3236a087c3a151b9625fb6b6a34b4e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/omise/omise-eccube/pulls/5/commits","review_comments_url":"https://api.github.com/repos/omise/omise-eccube/pulls/5/comments","review_comment_url":"https://api.github.com/repos/omise/omise-eccube/pulls/comments{/number}","comments_url":"https://api.github.com/repos/omise/omise-eccube/issues/5/comments","statuses_url":"https://api.github.com/repos/omise/omise-eccube/statuses/4a3d33d65a617c41bf073d359decd310e5b3bf8b","head":{"label":"omise:feature/eccube-2.13.3.0","ref":"feature/eccube-2.13.3.0","sha":"4a3d33d65a617c41bf073d359decd310e5b3bf8b","user":{"login":"omise","id":4662729,"avatar_url":"https://avatars.githubusercontent.com/u/4662729?v=3","gravatar_id":"","url":"https://api.github.com/users/omise","html_url":"https://github.com/omise","followers_url":"https://api.github.com/users/omise/followers","following_url":"https://api.github.com/users/omise/following{/other_user}","gists_url":"https://api.github.com/users/omise/gists{/gist_id}","starred_url":"https://api.github.com/users/omise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omise/subscriptions","organizations_url":"https://api.github.com/users/omise/orgs","repos_url":"https://api.github.com/users/omise/repos","events_url":"https://api.github.com/users/omise/events{/privacy}","received_events_url":"https://api.github.com/users/omise/received_events","type":"Organization","site_admin":false},"repo":{"id":40608337,"name":"omise-eccube","full_name":"omise/omise-eccube","owner":{"login":"omise","id":4662729,"avatar_url":"https://avatars.githubusercontent.com/u/4662729?v=3","gravatar_id":"","url":"https://api.github.com/users/omise","html_url":"https://github.com/omise","followers_url":"https://api.github.com/users/omise/followers","following_url":"https://api.github.com/users/omise/following{/other_user}","gists_url":"https://api.github.com/users/omise/gists{/gist_id}","starred_url":"https://api.github.com/users/omise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omise/subscriptions","organizations_url":"https://api.github.com/users/omise/orgs","repos_url":"https://api.github.com/users/omise/repos","events_url":"https://api.github.com/users/omise/events{/privacy}","received_events_url":"https://api.github.com/users/omise/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/omise/omise-eccube","description":"","fork":false,"url":"https://api.github.com/repos/omise/omise-eccube","forks_url":"https://api.github.com/repos/omise/omise-eccube/forks","keys_url":"https://api.github.com/repos/omise/omise-eccube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omise/omise-eccube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omise/omise-eccube/teams","hooks_url":"https://api.github.com/repos/omise/omise-eccube/hooks","issue_events_url":"https://api.github.com/repos/omise/omise-eccube/issues/events{/number}","events_url":"https://api.github.com/repos/omise/omise-eccube/events","assignees_url":"https://api.github.com/repos/omise/omise-eccube/assignees{/user}","branches_url":"https://api.github.com/repos/omise/omise-eccube/branches{/branch}","tags_url":"https://api.github.com/repos/omise/omise-eccube/tags","blobs_url":"https://api.github.com/repos/omise/omise-eccube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omise/omise-eccube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omise/omise-eccube/git/refs{/sha}","trees_url":"https://api.github.com/repos/omise/omise-eccube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omise/omise-eccube/statuses/{sha}","languages_url":"https://api.github.com/repos/omise/omise-eccube/languages","stargazers_url":"https://api.github.com/repos/omise/omise-eccube/stargazers","contributors_url":"https://api.github.com/repos/omise/omise-eccube/contributors","subscribers_url":"https://api.github.com/repos/omise/omise-eccube/subscribers","subscription_url":"https://api.github.com/repos/omise/omise-eccube/subscription","commits_url":"https://api.github.com/repos/omise/omise-eccube/commits{/sha}","git_commits_url":"https://api.github.com/repos/omise/omise-eccube/git/commits{/sha}","comments_url":"https://api.github.com/repos/omise/omise-eccube/comments{/number}","issue_comment_url":"https://api.github.com/repos/omise/omise-eccube/issues/comments{/number}","contents_url":"https://api.github.com/repos/omise/omise-eccube/contents/{+path}","compare_url":"https://api.github.com/repos/omise/omise-eccube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omise/omise-eccube/merges","archive_url":"https://api.github.com/repos/omise/omise-eccube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omise/omise-eccube/downloads","issues_url":"https://api.github.com/repos/omise/omise-eccube/issues{/number}","pulls_url":"https://api.github.com/repos/omise/omise-eccube/pulls{/number}","milestones_url":"https://api.github.com/repos/omise/omise-eccube/milestones{/number}","notifications_url":"https://api.github.com/repos/omise/omise-eccube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omise/omise-eccube/labels{/name}","releases_url":"https://api.github.com/repos/omise/omise-eccube/releases{/id}","deployments_url":"https://api.github.com/repos/omise/omise-eccube/deployments","created_at":"2015-08-12T15:26:38Z","updated_at":"2016-02-29T09:39:39Z","pushed_at":"2016-05-26T07:49:15Z","git_url":"git://github.com/omise/omise-eccube.git","ssh_url":"git@github.com:omise/omise-eccube.git","clone_url":"https://github.com/omise/omise-eccube.git","svn_url":"https://github.com/omise/omise-eccube","homepage":"https://www.omise.co/","size":230,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"omise:develop","ref":"develop","sha":"29f7234e1a26d8c9f5e60b992403b470a5070f4d","user":{"login":"omise","id":4662729,"avatar_url":"https://avatars.githubusercontent.com/u/4662729?v=3","gravatar_id":"","url":"https://api.github.com/users/omise","html_url":"https://github.com/omise","followers_url":"https://api.github.com/users/omise/followers","following_url":"https://api.github.com/users/omise/following{/other_user}","gists_url":"https://api.github.com/users/omise/gists{/gist_id}","starred_url":"https://api.github.com/users/omise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omise/subscriptions","organizations_url":"https://api.github.com/users/omise/orgs","repos_url":"https://api.github.com/users/omise/repos","events_url":"https://api.github.com/users/omise/events{/privacy}","received_events_url":"https://api.github.com/users/omise/received_events","type":"Organization","site_admin":false},"repo":{"id":40608337,"name":"omise-eccube","full_name":"omise/omise-eccube","owner":{"login":"omise","id":4662729,"avatar_url":"https://avatars.githubusercontent.com/u/4662729?v=3","gravatar_id":"","url":"https://api.github.com/users/omise","html_url":"https://github.com/omise","followers_url":"https://api.github.com/users/omise/followers","following_url":"https://api.github.com/users/omise/following{/other_user}","gists_url":"https://api.github.com/users/omise/gists{/gist_id}","starred_url":"https://api.github.com/users/omise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omise/subscriptions","organizations_url":"https://api.github.com/users/omise/orgs","repos_url":"https://api.github.com/users/omise/repos","events_url":"https://api.github.com/users/omise/events{/privacy}","received_events_url":"https://api.github.com/users/omise/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/omise/omise-eccube","description":"","fork":false,"url":"https://api.github.com/repos/omise/omise-eccube","forks_url":"https://api.github.com/repos/omise/omise-eccube/forks","keys_url":"https://api.github.com/repos/omise/omise-eccube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omise/omise-eccube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omise/omise-eccube/teams","hooks_url":"https://api.github.com/repos/omise/omise-eccube/hooks","issue_events_url":"https://api.github.com/repos/omise/omise-eccube/issues/events{/number}","events_url":"https://api.github.com/repos/omise/omise-eccube/events","assignees_url":"https://api.github.com/repos/omise/omise-eccube/assignees{/user}","branches_url":"https://api.github.com/repos/omise/omise-eccube/branches{/branch}","tags_url":"https://api.github.com/repos/omise/omise-eccube/tags","blobs_url":"https://api.github.com/repos/omise/omise-eccube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omise/omise-eccube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omise/omise-eccube/git/refs{/sha}","trees_url":"https://api.github.com/repos/omise/omise-eccube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omise/omise-eccube/statuses/{sha}","languages_url":"https://api.github.com/repos/omise/omise-eccube/languages","stargazers_url":"https://api.github.com/repos/omise/omise-eccube/stargazers","contributors_url":"https://api.github.com/repos/omise/omise-eccube/contributors","subscribers_url":"https://api.github.com/repos/omise/omise-eccube/subscribers","subscription_url":"https://api.github.com/repos/omise/omise-eccube/subscription","commits_url":"https://api.github.com/repos/omise/omise-eccube/commits{/sha}","git_commits_url":"https://api.github.com/repos/omise/omise-eccube/git/commits{/sha}","comments_url":"https://api.github.com/repos/omise/omise-eccube/comments{/number}","issue_comment_url":"https://api.github.com/repos/omise/omise-eccube/issues/comments{/number}","contents_url":"https://api.github.com/repos/omise/omise-eccube/contents/{+path}","compare_url":"https://api.github.com/repos/omise/omise-eccube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omise/omise-eccube/merges","archive_url":"https://api.github.com/repos/omise/omise-eccube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omise/omise-eccube/downloads","issues_url":"https://api.github.com/repos/omise/omise-eccube/issues{/number}","pulls_url":"https://api.github.com/repos/omise/omise-eccube/pulls{/number}","milestones_url":"https://api.github.com/repos/omise/omise-eccube/milestones{/number}","notifications_url":"https://api.github.com/repos/omise/omise-eccube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omise/omise-eccube/labels{/name}","releases_url":"https://api.github.com/repos/omise/omise-eccube/releases{/id}","deployments_url":"https://api.github.com/repos/omise/omise-eccube/deployments","created_at":"2015-08-12T15:26:38Z","updated_at":"2016-02-29T09:39:39Z","pushed_at":"2016-05-26T07:49:15Z","git_url":"git://github.com/omise/omise-eccube.git","ssh_url":"git@github.com:omise/omise-eccube.git","clone_url":"https://github.com/omise/omise-eccube.git","svn_url":"https://github.com/omise/omise-eccube","homepage":"https://www.omise.co/","size":230,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"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/omise/omise-eccube/pulls/5"},"html":{"href":"https://github.com/omise/omise-eccube/pull/5"},"issue":{"href":"https://api.github.com/repos/omise/omise-eccube/issues/5"},"comments":{"href":"https://api.github.com/repos/omise/omise-eccube/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/omise/omise-eccube/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/omise/omise-eccube/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/omise/omise-eccube/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/omise/omise-eccube/statuses/4a3d33d65a617c41bf073d359decd310e5b3bf8b"}}}}
{"actor":{"display_login":"guzzilar"}}