{"id":2095,"date":"2019-01-01T12:13:18","date_gmt":"2019-01-01T12:13:18","guid":{"rendered":"http:\/\/www.softaculous.com\/blog\/?post_type=docs&#038;p=2095"},"modified":"2024-10-23T09:38:03","modified_gmt":"2024-10-23T09:38:03","slug":"whmcs-licensing-hook","status":"publish","type":"docs","link":"https:\/\/www.softaculous.com\/blog\/docs\/developers\/whmcs\/whmcs-licensing-hook\/","title":{"rendered":"WHMCS Licensing Hook"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Overview<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Do you want to offer Softaculous as an addon to your VPS\/Dedicated server clients&nbsp;? We have a WHMCS hook for that.&nbsp;<br>This guide will help you to setup WHMCS hook to license Softaculous with your existing VPS\/Dedicated Server product. Setting this up is very easy.<\/p>\n\n\n\n<p class=\"alert alert-info wp-block-paragraph\"><strong>Note&nbsp;:<\/strong> You will need Softaculous NOC account to use this hook, because the API can be used only by NOCs. You can register as a NOC partner&nbsp;<a href=\"http:\/\/www.softaculous.com\/clients?ca=noc\">here<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Download and Upload<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For WHMCS 7.5+<\/strong>\u00a0<br>Download the Hook here\u00a0<a href=\"https:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2024\/10\/SoftLicenseHook.zip\" target=\"_blank\" rel=\"noreferrer noopener\">File:SoftLicenseHook.zip<\/a><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For WHMCS version less than 7.5<\/strong>&nbsp;<br>Download the Hook here if your are using WHMCS on PHP 5.3.x to PHP 5.5.x&nbsp;<a href=\"http:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2019\/05\/SoftLicenseHook_php53-1.zip\">File:SoftLicenseHook php53.zip<\/a>.<br>Download the Hook here if your are using WHMCS on PHP 5.6.x to PHP 7.0.x&nbsp;<a href=\"http:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2019\/05\/SoftLicenseHook_php56.zip\">File:SoftLicenseHook php56.zip<\/a>.<br>Download the Hook here if your are using WHMCS on PHP 7.1.x to PHP 7.2.x&nbsp;<a href=\"http:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2019\/05\/SoftLicenseHook_php71-2.zip\">File:SoftLicenseHook php71.zip<\/a>.<br>Download the Hook here if your are using WHMCS on PHP 5.2.x&nbsp;<a href=\"http:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2019\/05\/SoftLicenseHook_php52-1.zip\">File:SoftLicenseHook php52.zip<\/a>.<br><br>Unzip it and upload the files&nbsp;<strong>softaculous_license.php<\/strong>,&nbsp;<strong>softaculous_license_conf.php<\/strong>&nbsp;and&nbsp;<strong>noc_api.inc<\/strong>&nbsp;to the following path<\/p>\n\n\n\n<pre class=\"wp-block-preformatted bash hljs\">\/path\/to\/whmcs\/includes\/hooks\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Adding Configurable Option<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First go to&nbsp;<strong>WHMCS admin panel -&gt; Setup -&gt; Products\/Services -&gt; Configurable Options<\/strong><\/li>\n\n\n\n<li>Now create a Group or edit the existing group (Make sure that you have selected your product while adding the group).<\/li>\n\n\n\n<li>Now click on the&nbsp;<strong>Add New Configurable Option<\/strong>&nbsp;button.<\/li>\n\n\n\n<li>You will get a form similar to the below image.<\/li>\n\n\n\n<li>Fill in the details&nbsp;:\n<ul class=\"wp-block-list\">\n<li><strong>Option Name<\/strong>&nbsp;=&gt;&nbsp;<strong>Auto Installer<\/strong>&nbsp;If you would like to use some other name please edit the value for&nbsp;<strong>$GLOBALS[&#8216;softaculous_conf&#8217;][&#8216;fields&#8217;][&#8216;Auto Installer&#8217;]<\/strong>&nbsp;in&nbsp;<strong>softaculous_license_conf.php<\/strong><\/li>\n\n\n\n<li><strong>Option 1<\/strong>&nbsp;=&gt;&nbsp;<strong>Softaculous Auto Installer<\/strong><\/li>\n\n\n\n<li><strong>Option 2<\/strong>&nbsp;=&gt;&nbsp;<strong>None<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"alert alert-info wp-block-paragraph\"><strong>NOTE<\/strong>&nbsp;: The above values should be the same. Set the pricing as you wish.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"896\" height=\"287\" src=\"http:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2019\/01\/ConfigOptionsHook.jpg\" alt=\"\" class=\"wp-image-2096\" srcset=\"https:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2019\/01\/ConfigOptionsHook.jpg 896w, https:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2019\/01\/ConfigOptionsHook-300x96.jpg 300w, https:\/\/www.softaculous.com\/blog\/wp-content\/uploads\/2019\/01\/ConfigOptionsHook-768x246.jpg 768w\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Editing a Product\/Service<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This guide assumes you have already setup WHMCS and created your product. You can find detailed guides on the&nbsp;<a href=\"http:\/\/wiki.whmcs.com\/\">WHMCS Wiki<\/a>. Once the Product is setup you can move ahead with testing the Module.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Editing the Settings<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the settings in&nbsp;<strong>softaculous_license_conf.php<\/strong>&nbsp;<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. (Required) Edit the Softaculous NOC account login details<\/p>\n\n\n\n<pre class=\"wp-block-preformatted php hljs\">$conf_softaculous['noc_username'] = 'example'; \/\/Softaculous NOC username\n$conf_softaculous['noc_password'] = 'example'; \/\/Softaculous NOC user password<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the Softaculous NOC account details i.e.&nbsp;<strong>Softaculous Username<\/strong>&nbsp;and&nbsp;<strong>Softaculous Password<\/strong>. These details are required as the licenses will be issued under this account.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. (Optional) Edit the WHMCS admin account username<\/p>\n\n\n\n<pre class=\"wp-block-preformatted php hljs\">$conf_softaculous['whmcs_admin'] = 'whmcs_admin'; \/\/WHMCS admin username<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the WHMCS admin account username. This username is required to perform WHMCS API actions from within the module for WHMCS versions lower than WHMCS 7.2&nbsp;<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. (Required) Edit the&nbsp;<strong>pid<\/strong>&nbsp;of the products which are Dedicated servers and the ones which are VPS.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted php hljs\">$conf_softaculous['vps_pid'] = array();\n$conf_softaculous['dedicated_pid'] = array();<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is to determine if you will need Softaculous VPS license or a Dedicated server license.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. (Optional) Edit the&nbsp;<strong>gid<\/strong>&nbsp;of the product groups which are Dedicated servers and the ones which are VPS.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted php hljs\">$conf_softaculous['vps_gid'] = array();\n$conf_softaculous['dedicated_gid'] = array();<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is to determine if you will need Softaculous VPS license or a Dedicated server license.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. (Optional) Edit the&nbsp;<strong>pid<\/strong>&nbsp;of the products you want this hook to be executed for. By default this hook will be executed for the products that have the Configurable option (you created above) assigned.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted php hljs\">$conf_softaculous['product_id'] = array();<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5. (Optional) If you would like to debug set the debug mode to&nbsp;<strong>1<\/strong>&nbsp;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted php hljs\">$conf_softaculous['debug'] = 1;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Testing the Setup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can test the setup by making a DUMMY Order and accepting the order.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Support<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you need any assistance then please contact Softaculous Support.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Vote<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you find this addon useful please vote for us&nbsp;:&nbsp;<br><a href=\"http:\/\/www.whmcs.com\/appstore\/3542\/Softaculous-Licensing-Hook.html\">http:\/\/www.whmcs.com\/appstore\/3542\/Softaculous-Licensing-Hook.html<\/a><\/p>\n","protected":false},"featured_media":0,"parent":1690,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","docs_category":[],"class_list":["post-2095","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs\/2095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/comments?post=2095"}],"version-history":[{"count":19,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs\/2095\/revisions"}],"predecessor-version":[{"id":5948,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs\/2095\/revisions\/5948"}],"up":[{"embeddable":true,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs\/1690"}],"wp:attachment":[{"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/media?parent=2095"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs_category?post=2095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}