WHMCS Module

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.

Installation

Pre-requirements:

  • WHMCS (>= 7.2)
  1. Download the module: https://downloads.gametron.io/integrations/whmcs.zip.

  2. Extract the module .zip file to the /modules/servers/gametron folder of your WHMCS installation.

Configuration

1. Connecting WHMCS to a Gametron Master

  1. In WHMCS, go to Setup → Products/Services → Servers.

  2. Click Add New Server.

  3. In the Module dropdown, select Gametron.

  4. In the Hostname or IP Address field, enter the hostname of your Gametron master.

  5. Generate an API key in Gametron and paste it in the Access Hash field.

  6. Click Test Connection to make sure WHMCS can connect to the Gametron master.

  7. Make sure the Secure checkbox is checked under Server Details and that the port is 443.

  8. Click Save Changes.

You only need to add one server in WHMCS regardless of the amount of slaves you use.

2. Creating a Welcome Email Template

  1. In WHMCS, go to Setup → Email Templates.

  2. 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.

  1. In the body of the template, paste the following contents as HTML by clicking Enable/Disable Rich-Text Editor:
<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&amp;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.
  1. Give the template a name and in the Subject field and customize the rest of the template to your liking.

  2. Click Save Changes.

3. Creating a Product

  1. In WHMCS, go to Setup → Products/Services → Products/Services.

  2. Click Create a New Group.

  3. Give the product group a name in the Product Group Name. The rest of the fields are optional.

  4. Click Save Changes.

  5. Click Create a New Product.

  6. As Product Type, choose Other. As Product Group, select the group you created earlier. Fill out the Product Name field.

  7. In the Module dropdown, select Gametron.

  8. Click Continue.

You will be taken to the product settings page.

  1. Uncheck the Require Domain checkbox.

  2. In the Welcome Email dropdown, select the welcome email template you created earlier.

  3. 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.

  4. Click Save Changes.

The product will now be provisioned with the module when a new order is placed and marked as paid.

Location Selector

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.

  1. In WHMCS, go to Setup → Products/Services → Configurable Options.

  2. If you don’t have one already, create a new configurable option group for your product by clicking Create a New Group.

  3. Enter a name for the group in the Group Name field. Select your Gametron product in the Assigned Products dropdown.

  4. Click Save Changes.

  5. Click Add New Configurable Option.

  6. 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”.

  7. Set the Option Type to Dropdown.

  8. Add a new option for each location you want to use using the Add Option: field.

  9. 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”.

  10. When you have added all locations, click Save Changes and then Close Window.

The location selector should now appear on the order form.

Dedicated IPs

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.

  1. In WHMCS, go to Setup → Products/Services → Configurable Options.

  2. If you don’t have one already, create a new configurable option group for your product by clicking Create a New Group.

  3. 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.

  4. Click Save Changes.

  5. Click Add New Configurable Option.

  6. 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”.

  7. Set the Option Type to Yes/No.

  8. Add a description for the dedicated IP in the Add Option: field. This will appear on the order form.

  9. Set the price to the amount you want to charge for the dedicated IP.

  10. Click Save Changes and then Close Window.

The dedicated IP address option should now appear on the order form.