{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/217016352","pull_request_review_id":154630552,"id":217016352,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzAxNjM1Mg==","diff_hunk":"@@ -0,0 +1,383 @@\n+<?php\n+\n+use WHMCS\\Database\\Capsule;\n+\n+if (!defined(\"WHMCS\")) {\n+    die(\"This file cannot be accessed directly\");\n+}\n+\n+\n+/**\n+ * A WHMCS module for use by Jetpack hosting partners to provision Jetpack plans.\n+ * The module provides functionality for partner hosts to be able to save their\n+ * client id and secret to request an access token for provisioning plans.\n+ *\n+ * Plans available for provisioning include free, personal, premium and professional\n+ *\n+ * A host has options to either provision(Create == WHMCS equivalent functional term)\n+ * or Cancel(Terminate == WHMCS equivalent functional term) from the WHMCS client area.\n+ *\n+ * Host setup for custom fields is currently required in order to use the module.\n+ *\n+ */\n+\n+/**\n+ * Jetpack Meta Data for WHMCS module. This is what is shown specifically when the host\n+ * is setting up the module.\n+ *\n+ * @return array\n+ */\n+function jetpack_MetaData()\n+{\n+    return [\n+        'DisplayName' => 'Jetpack by Automattic',\n+        'Description' => 'Use this module to provision Jetpack plans with your Jetpack hosting partner account',\n+        'APIVersion' => '1.1',\n+        'RequiresServer' => false,\n+    ];\n+}\n+\n+\n+/**\n+ * Basic configuration options required for a partner to get a Jetpack plan provisioned. Currently a partner\n+ * client id and secret are the only host partner options needed to get an access token to provision a Jetpack plan\n+ * @return array\n+ */\n+function jetpack_ConfigOptions()\n+{\n+    return [\n+        'Jetpack Partner Client ID' => [\n+            'Type' => 'text',\n+            'Size' => '256',\n+        ],\n+        'Jetpack Partner Client Secret' => [\n+            'Type' => 'text',\n+            'Size' => '256',\n+        ]\n+    ];\n+}\n+\n+\n+/**\n+ * Equivalent to /provision. Create a Jetpack plan using\n+ * a Jetpack Hosting partner account. WHMCS expects the string \"success\"\n+ * to be returned if the process is completed successfully otherwise\n+ * a string can be returned which will be logged as part of the error.\n+ *\n+ * Pre Provisioning Steps:\n+ *  Module requirements are validated and will return an error string\n+ *  if the module was not setup correctly. An error string will also be\n+ *  returned in the event that a request to provision a new plan returns a\n+ *  4xx or 5xx error.\n+ *\n+ *  An Access token will also be retrieved before trying to provision a plan.\n+ * \tIf the access_token_details array does not contain the access token string it will\n+ *  contain errors about what went wrong with getting the access token which should be\n+ *  returned to the partner host\n+ *\n+ * If the response from provisioning does not contain \"success\" in the message\n+ * consider the provisioning to be incomplete and get a useful error from the response\n+ *\n+ * @param array WHMCS $params\n+ * @return string Either 'success' or an error with what went wrong when provisioning\n+ */\n+function jetpack_CreateAccount(array $params)\n+{\n+\n+    $module_errors = validate_required_fields($params);\n+    if ($module_errors !== true) {\n+        return $module_errors;\n+    }\n+\n+    $access_token_details = get_access_token($params);\n+    if (isset($access_token_details['access_token'])) {\n+        $access_token = $access_token_details['access_token'];\n+    } else {\n+        return $access_token_details['errors'];\n+    }\n+\n+    $provisioning_url = \"https://public-api.wordpress.com/rest/v1.3/jpphp/provision\";\n+    $stripped_url = preg_replace(\"(^https?://)\", \"\", $params['customfields']['Site URL']);\n+    $stripped_url = rtrim($stripped_url, '/');\n+\n+    $request_data = [\n+        'plan' => strtolower($params['customfields']['Plan']),\n+        'siteurl' => $stripped_url,\n+        'local_user' => $params['customfields']['Local User'],\n+        'force_register' => true,\n+    ];\n+\n+    $response = make_api_request($provisioning_url, $access_token, $request_data);\n+    if (isset($response->success) && $response->success === true) {\n+        if ($response->next_url) {\n+            save_provisioning_details($response->next_url, $params);\n+        } else {\n+            save_provisioning_details($response->next_url, $params, true);\n+        }\n+        return 'success';\n+    } else {\n+        $errors = get_provisioning_errors_from_response($response);\n+        return $errors;\n+    }\n+}\n+\n+/**\n+ * Equivalent to partner/cancel. Cancel a Jetpack plan using using a Jetpack Hosting partner account. This has\n+ * the same prerequiste steps as jetpack_createAccount and will return an error string if the module has not been\n+ * setup correctly or there was a failure getting an access token.\n+ *\n+ * The url scheme for the site being cancelled is not necessary when making this request and is stripped along\n+ * with trailing slashes\n+ *\n+ * If the response json does not contain \"success\" return error strings based on the response properties\n+ *\n+ * @param array WHMCS $params\n+ * @return string Either 'success' or an error with what went wrong when provisioning\n+ */\n+function jetpack_TerminateAccount(array $params)\n+{\n+    $module_errors = validate_required_fields($params);\n+    if ($module_errors !== true) {\n+        return $module_errors;\n+    }\n+\n+    $access_token_details = get_access_token($params);\n+    if (isset($access_token_details['access_token'])) {\n+        $access_token = $access_token_details['access_token'];\n+    } else {\n+        return $access_token_details['errors'];\n+    }\n+\n+    $stripped_url = preg_replace(\"(^https?://)\", \"\", $params['customfields']['Site URL']);\n+    $clean_url = rtrim($stripped_url, '/');\n+    $clean_url = str_replace('/', '::', $clean_url);\n+\n+\n+    $request_url = 'https://public-api.wordpress.com/rest/v1.3/jpphp/' . $clean_url . '/partner-cancel';\n+    $response = make_api_request($request_url, $access_token);\n+\n+    if (isset($response->success) && $response->success === true) {\n+        return 'success';\n+    } elseif ($response->success === false) {\n+        return 'JETPACK MODULE: Unable to cancel this Jetpack plan as it has likely already been cancelled';\n+    } else {\n+        $errors = get_cancellation_errors_from_response($response);\n+        return $errors;\n+    }\n+\n+}\n+\n+/**\n+ * Get a Jetpack partner access token using the client_id and client secret\n+ * stored when the product was created in the WHMCS product settings. If the\n+ * response does not explicitly contain an access token provisioning or cancellation\n+ * cannot be attempted so return an error string.\n+ *\n+ *\n+ * @param array $params WHMCS params\n+ * @return array An array that contains a set property of either the access token\n+ * or errors that happened while trying to get an access token.\n+ */\n+function get_access_token($params)\n+{\n+\n+    $oauth_url = \"https://public-api.wordpress.com/oauth2/token\";\n+\n+    $credentials = [\n+        'client_id' => $params['configoption1'],\n+        'client_secret' => $params['configoption2'],\n+        'grant_type' => 'client_credentials',\n+        'scope' => 'jetpack-partner'\n+    ];\n+\n+    $response = make_api_request($oauth_url, null, $credentials);\n+    $access_token_response = [\n+        'access_token' => null,\n+        'errors' => null\n+    ];\n+    if (isset($response->access_token)) {\n+        $access_token_response['access_token'] = $response->access_token;\n+        return $access_token_response;\n+    } else {\n+        $errors = get_authentication_errors_from_response($response);\n+        $access_token_response['errors'] = $errors;\n+        return $access_token_response;\n+    }\n+}\n+\n+\n+/**\n+ * Make an API request for authenticating and provisioning or cancelling a Jetpack plan or getting an access token.\n+ * Include the http status in the response.\n+ *\n+ * @param string $url where to make the request to\n+ * @param string $auth access token to make a provisioning or cancellation request\n+ * @param array $data form data for the api request\n+ * @return mixed json_decoded response\n+ * @throws Exception On a curl error or an empty body an Exception will be thrown.\n+ */\n+function make_api_request($url, $auth = null, $data = null)\n+{\n+\n+    if (isset($auth)) {\n+        $auth = \"Authorization: Bearer \" . $auth;\n+    }\n+\n+    $curl = curl_init();\n+    curl_setopt_array($curl, [\n+        CURLOPT_HTTPHEADER => [$auth],\n+        CURLOPT_URL => $url,\n+        CURLOPT_RETURNTRANSFER => true,\n+        CURLOPT_ENCODING => \"\",\n+        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n+        CURLOPT_POSTFIELDS => $data,\n+        CURLOPT_CUSTOMREQUEST => \"POST\"\n+    ]);\n+\n+    $response = curl_exec($curl);\n+    $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n+    if (curl_error($curl)) {\n+        throw new Exception('Unable to connect: ' . curl_errno($curl) . ' - ' . curl_error($curl));\n+    } elseif (empty($response)) {\n+        throw new Exception('Empty response');\n+    }\n+\n+\n+    $decoded_response = json_decode($response);\n+    $decoded_response->http_status = $http_code;\n+    curl_close($curl);\n+\n+    return $decoded_response;\n+}\n+\n+/**\n+ * Save the next_url for Jetpack activation/setup to the order for the client. If a next url is not set or is empty\n+ * and the pending param is true save a message letting the user know a plan is pending and will\n+ * be available once the domain the plan is being provisioned for resolves\n+ *\n+ * @param string $url The next url for activating the Jetpack plan\n+ * @param array $params WHMCS params\n+ * @param bool $pending If the plan is pending domain resolution.\n+ */\n+function save_provisioning_details($url, $params, $pending = false)\n+{\n+    $jetpack_next_url_field = Capsule::table('tblcustomfields')\n+        ->where(['fieldname' => 'jetpack_provisioning_details', 'type' => 'product'])->first();\n+\n+    $details = '';\n+    if ($url) {\n+        $details = 'URL to Activate Jetpack: ' . $url;\n+    } elseif ($pending) {\n+        $details = 'The domain did not appear to resolve when provisioning was attempted however a Jetpack plan is \n+        waiting for ' . $params['customfields']['Site URL'] . '. Once DNS resolves please connect the site via \n+        the Jetpack Banner in the sites dashboard';\n+    }\n+    Capsule::table('tblcustomfieldsvalues')->where(['fieldid' => $jetpack_next_url_field->id])->update([\n+        'relid' => $params['model']['orderId'], 'value' => $details]);\n+}\n+\n+/**\n+ * Validate that the module was correctly set up when the product was\n+ * created by the WHMCS user and that the required Fields/Options for\n+ * being able to provision a Jetpack plan are present. Fields validated are\n+ *  - Allowed Plans from Plan Custom Field\n+ *  - Required Custom Fields\n+ *  - Required Config Options\n+ *\n+ * @param array $params WHMCS params\n+ * @return bool|string An error describing what was not correctly included in the setup of the module or True if\n+ * everything checks out and provisioning can be attempted.\n+ */\n+function validate_required_fields(array $params)\n+{\n+    $allowed_plans = ['free', 'personal', 'premium', 'professional'];\n+    $required_custom_fields = ['Plan', 'Site URL', 'Local User', 'jetpack_provisioning_details'];\n+\n+    foreach ($required_custom_fields as $field) {\n+        if (!isset($params['customfields'][$field])) {\n+            return 'JETPACK MODULE: The module does not appear to be setup correctly. The required custom field '\n+                . $field . ' was not setup when the product was created.\n+\t\t\t\tPlease see the module documentation for more information';\n+        }\n+    }\n+\n+    if (!in_array(strtolower($params['customfields']['Plan']), $allowed_plans)) {\n+        return 'JETPACK MODULE: The module does not appear to be setup correctly. ' .\n+            $params['customfields']['Plan'] . ' is not an allowed plan';","path":"partner/WHMCS/modules/servers/jetpack/jetpack.php","position":306,"original_position":306,"commit_id":"542a165647bca14d77a50c3e0c55289c4b270b9f","original_commit_id":"542a165647bca14d77a50c3e0c55289c4b270b9f","user":{"login":"olska","id":42440288,"node_id":"MDQ6VXNlcjQyNDQwMjg4","avatar_url":"https://avatars1.githubusercontent.com/u/42440288?v=4","gravatar_id":"","url":"https://api.github.com/users/olska","html_url":"https://github.com/olska","followers_url":"https://api.github.com/users/olska/followers","following_url":"https://api.github.com/users/olska/following{/other_user}","gists_url":"https://api.github.com/users/olska/gists{/gist_id}","starred_url":"https://api.github.com/users/olska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olska/subscriptions","organizations_url":"https://api.github.com/users/olska/orgs","repos_url":"https://api.github.com/users/olska/repos","events_url":"https://api.github.com/users/olska/events{/privacy}","received_events_url":"https://api.github.com/users/olska/received_events","type":"User","site_admin":false},"body":"@nb I also did verify this in the database table for custom fields to be sure things are as expected. ","created_at":"2018-09-12T12:51:31Z","updated_at":"2018-09-12T12:51:31Z","html_url":"https://github.com/Automattic/jetpack/pull/10036#discussion_r217016352","pull_request_url":"https://api.github.com/repos/Automattic/jetpack/pulls/10036","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/217016352"},"html":{"href":"https://github.com/Automattic/jetpack/pull/10036#discussion_r217016352"},"pull_request":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/10036"}},"in_reply_to_id":216838810},"pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/10036","id":209396345,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5Mzk2MzQ1","html_url":"https://github.com/Automattic/jetpack/pull/10036","diff_url":"https://github.com/Automattic/jetpack/pull/10036.diff","patch_url":"https://github.com/Automattic/jetpack/pull/10036.patch","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/10036","number":10036,"state":"open","locked":false,"title":"WHMCS module","user":{"login":"olska","id":42440288,"node_id":"MDQ6VXNlcjQyNDQwMjg4","avatar_url":"https://avatars1.githubusercontent.com/u/42440288?v=4","gravatar_id":"","url":"https://api.github.com/users/olska","html_url":"https://github.com/olska","followers_url":"https://api.github.com/users/olska/followers","following_url":"https://api.github.com/users/olska/following{/other_user}","gists_url":"https://api.github.com/users/olska/gists{/gist_id}","starred_url":"https://api.github.com/users/olska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olska/subscriptions","organizations_url":"https://api.github.com/users/olska/orgs","repos_url":"https://api.github.com/users/olska/repos","events_url":"https://api.github.com/users/olska/events{/privacy}","received_events_url":"https://api.github.com/users/olska/received_events","type":"User","site_admin":false},"body":"Start for a provisioning module for WHMCS for use by Jetpack hosting partners to provision and cancel Jetpack plans.\r\n\r\nCurrently handles 2 WHMCS core module functions for creating and terminating accounts (provisioning and cancelling Jetpack plans).\r\n\r\nFixes #\r\n\r\nThe PR includes a new partner directory that contains a WHMCS module to allow Jetpack hosting partners to provision Jetpack plans from WHMCS or automatically on checkout. No fixes or additions to Jetpack are included\r\n\r\n*\r\n\r\n#### Testing instructions:\r\nTo test the module a working WHMCS instance with a valid license as well as a Jetpack hosting partner account and the associated client id and client secret are necessary. Below are setup and usage instructions for testing once the previous 2 requirements are ready. Additional information including troubleshooting directions can be found in the full README in `/partner/WHMCS`\r\n\r\n### Installation/Setup:\r\nTo install the module upload the ```/jetpack``` folder to the ```/modules/servers``` directory of your WHMCS installation. A server is not required for the module to function so the module will not be listed in the WHMCS Servers under the Setup tab for Products/Servers. Once uploaded to WHMCS the module is ready for use when making a new product in WHMCS. To setup a new product go to the Setup tab and locate Products/Services. You will first need to create a product group after which you can select the Create Product option and add a new product for Jetpack provisioning.\r\n\r\n### Usage:\r\nTo use the module create a new product in one of your existing product groups. As part of the product creation process in the Module Settings tab select the “Jetpack by Automattic” module to get started. You will need to have an established Jetpack Hosting Partner account and your client_id and client_secret will be requested in order to create the product and use the module so have these handy when creating the new product. \r\n\r\nWhen setting up the module 4 custom fields will need to be added in order for the module to work correctly. These fields are verified whenever the module is utilized to create an account. The first 3 fields are required in order to provision a Jetpack plan. They can optionally be shown on the order form to allow your users to include these when checking out and assist with easier provisioning. This is the “Show on Order Form” option when creating custom fields within WHMCS. The last field is used to store details on the response from a provisioning attempt and should not be shown on the order form. When a user is provisioning a new plan this will typically be a URL that they will need to connect the plan you have provisioned for them to their https://wordpress.com account and get started with their Jetpack plan. Please use the field names exactly as shown below as these will be validated when the module is used for provisioning. The fields required are as follows:\r\n\r\n\r\n| Field Name | Field Type | Required | Show on Order Form | Value |\r\n| ------ | ------ | ------ | ------ | ------\r\n| Site URL | Text Box | Yes | Optional | User input field\r\n| Local User | Text Box | Yes | Optional | User input field\r\n| Plan | Drop Down | Yes | Optional | (Free,Personal,Premium,Professional)\r\n| jetpack_provisioning_details | Text Area | No | No | **Not a user field**\r\n\r\n*\r\n\r\n<!-- Add the following only if this is meant to be in changelog -->\r\n#### Proposed changelog entry for your changes:\r\n","created_at":"2018-08-20T02:21:55Z","updated_at":"2018-09-12T12:51:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6edaf739d06365807545a4f283084200b541ed66","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"Jetpack","id":2149533,"node_id":"MDQ6VGVhbTIxNDk1MzM=","slug":"jetpack","description":"The Jetpack team, who has merge access for Jetpack","privacy":"closed","url":"https://api.github.com/teams/2149533","members_url":"https://api.github.com/teams/2149533/members{/member}","repositories_url":"https://api.github.com/teams/2149533/repos","permission":"pull"}],"labels":[{"id":136297617,"node_id":"MDU6TGFiZWwxMzYyOTc2MTc=","url":"https://api.github.com/repos/Automattic/jetpack/labels/Trial%20Project","name":"Trial Project","color":"d5ad6f","default":false},{"id":136599217,"node_id":"MDU6TGFiZWwxMzY1OTkyMTc=","url":"https://api.github.com/repos/Automattic/jetpack/labels/[Status]%20In%20Progress","name":"[Status] In Progress","color":"ededed","default":false},{"id":70896534,"node_id":"MDU6TGFiZWw3MDg5NjUzNA==","url":"https://api.github.com/repos/Automattic/jetpack/labels/[Type]%20Enhancement","name":"[Type] Enhancement","color":"c7def8","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/jetpack/pulls/10036/commits","review_comments_url":"https://api.github.com/repos/Automattic/jetpack/pulls/10036/comments","review_comment_url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/10036/comments","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/542a165647bca14d77a50c3e0c55289c4b270b9f","head":{"label":"Automattic:whmcs-jetpack-partner-module","ref":"whmcs-jetpack-partner-module","sha":"542a165647bca14d77a50c3e0c55289c4b270b9f","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIzMTIxMg==","name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2018-09-12T02:05:58Z","pushed_at":"2018-09-12T12:16:36Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"https://jetpack.com/","size":215283,"stargazers_count":838,"watchers_count":838,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":538,"mirror_url":null,"archived":false,"open_issues_count":1041,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":538,"open_issues":1041,"watchers":838,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"290f570169e673f4e698b1218ffca25bbfa1161d","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIzMTIxMg==","name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2018-09-12T02:05:58Z","pushed_at":"2018-09-12T12:16:36Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"https://jetpack.com/","size":215283,"stargazers_count":838,"watchers_count":838,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":538,"mirror_url":null,"archived":false,"open_issues_count":1041,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":538,"open_issues":1041,"watchers":838,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/10036"},"html":{"href":"https://github.com/Automattic/jetpack/pull/10036"},"issue":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/10036"},"comments":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/10036/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/10036/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/10036/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/jetpack/statuses/542a165647bca14d77a50c3e0c55289c4b270b9f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"olska"}}