Skip to content

LeonardoManrich/Cpanel-Whm-PHP-SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDK for cpanel/whm and WHMCS api's

Currently in development

WHMCS

Usage:

include 'vendor/autoload.php';

use Leonardomanrich\Cpanelwhm\Api\WHMCS;
use Leonardomanrich\Cpanelwhm\Http\HttpClient;
use Leonardomanrich\Cpanelwhm\Modules\WHMCS\Users;

$environment = new WHMCS(
    'https://domain.com.br',
    'identifier',
    'secret'
);

$cpanelClient = new HttpClient($environment);

$Users = new Users();

$result = $cpanelClient->execute($Users->getUsers())->result;

you can find out how to create API credentials at WHMCS API_Authentication_Credentials

all whmcs classes are stored in namespace Leonardomanrich\Cpanelwhm\Modules\WHMCS\ and all functions follow documentation standard WHMCS api documentation.

Examples:

See on WHMCS api GetOrders

use Leonardomanrich\Cpanelwhm\Modules\WHMCS\Orders;

$Orders = new Orders();

$result = $cpanelClient->execute(
    $Orders->getOrders(
        $limitstart, 
        $limitnum, 
        $id, 
        $userid, 
        $requestor_id, 
        $status
    )
)->result;

See on WHMCS api AddUser

    
use Leonardomanrich\Cpanelwhm\Modules\WHMCS\Users;

$Users = new Users();

$result = $cpanelClient->execute(
    $Users->addUser(
        'Jon',
        'Doe',
        'JonDoe@email.com',
        'JonDoe123',
        'portuguese'
    )
)->result;