This module can be used to automate the provisioning of servers using WHMCS.
The WHMCS module currently supports only provisioning and managing Minecraft servers. Support for other games will be added in the future.
Pre-requirements:
Download the module: https://downloads.gametron.io/integrations/whmcs.zip.
Extract the module .zip file to the /modules/servers/gametron folder of your WHMCS installation.
In WHMCS, go to Setup → Products/Services → Servers.
Click Add New Server.
In the Module dropdown, select Gametron.
In the Hostname or IP Address field, enter the hostname of your Gametron master.
Generate an API key in Gametron and paste it in the Access Hash field.
Click Test Connection to make sure WHMCS can connect to the Gametron master.
Make sure the Secure checkbox is checked under Server Details and that the port is 443.
Click Save Changes.
You only need to add one server in WHMCS regardless of the amount of slaves you use.
In WHMCS, go to Setup → Email Templates.
Under Create New Email Template, choose set Email Type to Product/Service. Give the email template a name in the Unique Name field and click Create.
You will be taken to the new email template.
<p>Dear {$client_name},</p>
<p align="center"><strong>PLEASE READ THIS EMAIL IN FULL AND PRINT IT FOR YOUR RECORDS</strong></p>
<p>Thank you for your order from us! Your game server has now been set up and this email contains all the information you will need in order to begin using your server.</p>
<p>Your game server uses the Gametron control panel. If this is your first game server from us that uses Gametron, you can use the following credentials to sign in to your control panel. If you already have a server with us, use your existing credentials instead.<br /><br /></p>
<p><strong>Control Panel<br /></strong></p>
<p>Email: {$service_username}<br />Password: {$service_password}</p>
<p>Control Panel URL: <a href="https://{$service_server_hostname}" target="_blank">https://{$service_server_hostname}</a><br /><br />Sign in to the <a href="https://{$service_server_hostname}" target="_blank">control panel</a> or <a href="{$whmcs_url}clientarea.php?action=productdetails&id={$service_order_id}" target="_blank">client area</a> to view more information about your server, such as the IP address and port number.<br /><br /><strong>Billing Information<br /></strong>First Payment Amount: {$service_first_payment_amount}<br />Recurring Amount: {$service_recurring_amount}<br />Billing Cycle: {$service_billing_cycle}<br />Next Due Date: {$service_next_due_date}<br /><br /></p>
<p>Thank you for choosing us.</p>
<p>{$signature}</p>
If you would like to customize the email template, the following variables are available in email templates:
Variable | Description |
---|---|
{$service_custom_field_serverid} |
ID of the server in Gametron. |
{$service_custom_field_serverip} |
IP address of the server. |
{$service_custom_field_serverport} |
Port of the server. |
Give the template a name and in the Subject field and customize the rest of the template to your liking.
Click Save Changes.
In WHMCS, go to Setup → Products/Services → Products/Services.
Click Create a New Group.
Give the product group a name in the Product Group Name. The rest of the fields are optional.
Click Save Changes.
Click Create a New Product.
As Product Type, choose Other. As Product Group, select the group you created earlier. Fill out the Product Name field.
In the Module dropdown, select Gametron.
Click Continue.
You will be taken to the product settings page.
Uncheck the Require Domain checkbox.
In the Welcome Email dropdown, select the welcome email template you created earlier.
Go to Module Settings. Some Gametron-related settings will appear. Feel free to customize them to your liking. The Default Slave field will be used when provisioning new products of this type if no location selector is used to allow clients to choose a preferred location for their server.
Click Save Changes.
The product will now be provisioned with the module when a new order is placed and marked as paid.
The module allows you to create a location selector dropdown that allows clients to choose a preferred location for their server on the order form. To set up a location selector dropdown, follow the steps below.
In WHMCS, go to Setup → Products/Services → Configurable Options.
If you don’t have one already, create a new configurable option group for your product by clicking Create a New Group.
Enter a name for the group in the Group Name field. Select your Gametron product in the Assigned Products dropdown.
Click Save Changes.
Click Add New Configurable Option.
A new popup should open. In the Option Name, enter “Location”. If you want the the dropdown to have a different name on the order form, use the following format to set a custom name for it: “Location|dropdown-name”, e.g. “Location|Country”.
Set the Option Type to Dropdown.
Add a new option for each location you want to use using the Add Option: field.
Set the price to 0.00 unless you want to charge extra for a specific location. The option name should be in format “slave-id|location-name”, e.g. “57191575|Europe”.
When you have added all locations, click Save Changes and then Close Window.
The location selector should now appear on the order form.
The module allows you to create a dedicated IP option that allows clients to order a dedicated IP address for their server on the order form. To set up a dedicated IP option, follow the steps below.
In WHMCS, go to Setup → Products/Services → Configurable Options.
If you don’t have one already, create a new configurable option group for your product by clicking Create a New Group.
Enter a name for the group in the Group Name field and select the products you want to use the dedicated IP option with in the Assigned Products dropdown.
Click Save Changes.
Click Add New Configurable Option.
A new popup should open. In the Option Name, enter “Dedicated IP”. If you want the the dropdown to have a different name on the order form, use the following format to set a custom name for it: “Dedicated IP|dropdown-name”, e.g. “Dedicated IP|Dedicated IP Address”.
Set the Option Type to Yes/No.
Add a description for the dedicated IP in the Add Option: field. This will appear on the order form.
Set the price to the amount you want to charge for the dedicated IP.
Click Save Changes and then Close Window.
The dedicated IP address option should now appear on the order form.