{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/212814375","pull_request_review_id":149526484,"id":212814375,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjgxNDM3NQ==","diff_hunk":"@@ -183,14 +187,18 @@ function make_api_request($url, $auth='', $data=[])\n     ));\n \n     $response = curl_exec($curl);\n-    if (curl_error($curl)) {\n+    $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n+\n+    if ($http_code >= 400) {\n+        logModuleCall('jetpack', __FUNCTION__, $url, $data, $response);\n+        throw new Exception('Something Went wrong');","path":"partner/WHMCS/modules/servers/jetpack/jetpack.php","position":null,"original_position":124,"commit_id":"9d9c86f12ffd6f685dbb97344d8c0a836b60defb","original_commit_id":"6558f99aa2ccb0d624e2e5a2f7f6c596a5bc84b3","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've updated this as well based on the logModuleCall feedback from earlier 🙂. I had added more in a later commit to let the user know to enable Module Logging as this error message wasn't great but am now returning an error string indicating what likely went wrong when making the API request and returning this as the error string so it can be logged in the Activity Logs.","created_at":"2018-08-26T04:10:00Z","updated_at":"2018-08-26T04:10:00Z","html_url":"https://github.com/Automattic/jetpack/pull/10036#discussion_r212814375","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/212814375"},"html":{"href":"https://github.com/Automattic/jetpack/pull/10036#discussion_r212814375"},"pull_request":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/10036"}},"in_reply_to_id":212585310},"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-08-26T04:10:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21ce85c63491d518bfc9ebdb644caf9a81bc84b7","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/9d9c86f12ffd6f685dbb97344d8c0a836b60defb","head":{"label":"Automattic:whmcs-jetpack-partner-module","ref":"whmcs-jetpack-partner-module","sha":"9d9c86f12ffd6f685dbb97344d8c0a836b60defb","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-08-24T17:27:00Z","pushed_at":"2018-08-26T04:08:27Z","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":214048,"stargazers_count":816,"watchers_count":816,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":533,"mirror_url":null,"archived":false,"open_issues_count":1130,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":533,"open_issues":1130,"watchers":816,"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-08-24T17:27:00Z","pushed_at":"2018-08-26T04:08:27Z","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":214048,"stargazers_count":816,"watchers_count":816,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":533,"mirror_url":null,"archived":false,"open_issues_count":1130,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":533,"open_issues":1130,"watchers":816,"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/9d9c86f12ffd6f685dbb97344d8c0a836b60defb"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"olska"}}