Setup WHMCS Module

Overview

This guide explains how to set up and configure the RC Licensing System WHMCS module for automated license provisioning and management.

Requirements

Installation Steps

Step 1: Download the Module

Download the latest WHMCS License module from your account dashboard.

Step 2: Extract Files

Extract the downloaded file to your WHMCS installation directory:

unzip WHMCSLicense.zip
cp License.php YOUR-WHMCS-PATH/vendor/whmcs/whmcs-foundation/lib/License.php

Step 3: Set File Permissions

chmod 644 YOUR-WHMCS-PATH/vendor/whmcs/whmcs-foundation/lib/License.php
chown nobody:nobody YOUR-WHMCS-PATH/vendor/whmcs/whmcs-foundation/lib/License.php

Step 4: Update WHMCS Configuration

Edit your WHMCS configuration file and add:

define('RC_LICENSE_API_KEY', 'YOUR_API_KEY');
define('RC_LICENSE_MIRROR_URL', 'https://api.licensetube.com');

Step 5: Clear Cache

Clear WHMCS cache to load the new module:

rm -rf YOUR-WHMCS-PATH/templates_c/*
rm -rf YOUR-WHMCS-PATH/downloads/cache/*

Configuration

Module Settings

Navigate to Setup → Products/Services → Module Settings and configure:

Setting Description
API Key Your RC Licensing System API key
Mirror URL https://api.licensetube.com
Auto Provision Enable automatic license provisioning
Auto Suspend Automatically suspend expired licenses
Auto Terminate Automatically terminate canceled licenses

Product Configuration

Creating License Products

Create products for each license type:

  1. Go to Setup → Products/Services → Products/Services
  2. Click "Create a New Product"
  3. Select "Other" as the product type
  4. Fill in product details:
    • Product Name: cPanel License
    • Product Type: License
    • Module: RC Licensing
  5. Configure pricing and billing cycles
  6. Save the product

Configurable Options

Add configurable options for license selection:

Option Name: License Type
Option Type: Dropdown

Values:
- cPanel
- LiteSpeed
- CloudLinux
- Imunify360
- WordPress
- Softaculous

Automation Rules

Setting Up Automation

Auto Provision

Automatically provision licenses when orders are paid:

  1. Go to Automation → Provisioning
  2. Create new rule for license products
  3. Set trigger: "When order is paid"
  4. Set action: "Provision service"

Auto Suspend

Automatically suspend licenses when they expire:

  1. Go to Automation → Suspension
  2. Create new rule
  3. Set trigger: "When service expires"
  4. Set action: "Suspend service"

Auto Terminate

Automatically terminate canceled licenses:

  1. Go to Automation → Termination
  2. Create new rule
  3. Set trigger: "When service is canceled"
  4. Set action: "Terminate service"

Client Portal Integration

License Management

Clients can manage their licenses through the WHMCS client portal:

Custom Client Area Template

Customize the client area to display license information:

<?php
if ($service['status'] == 'Active') {
    echo 'License Status: Active';
    echo 'Installation Command: ' . $service['customfields']['install_command'];
}
?>

Troubleshooting

Module Not Loading

Issue: Module doesn't appear in product configuration

Solution:

Provisioning Fails

Issue: Licenses not provisioning automatically

Solution:

API Connection Error

Issue: Cannot connect to licensing API

Solution:

Advanced Configuration

Custom Hooks

Create custom hooks for additional functionality:

<?php
add_hook('LicenseProvisioned', 1, function($vars) {
    // Custom code after license provisioning
    sendCustomNotification($vars);
});
?>

API Integration

Use the WHMCS API to manage licenses programmatically:

<?php
$command = 'GetClientsProducts';
$postData = array(
    'clientid' => 123,
    'status' => 'Active'
);
$results = localAPI($command, $postData);
?>

Best Practices

Support

For WHMCS module support, please contact us through our website or check the API documentation.