User.external_id
=serviceid
in WHMCS- Uses the following labels:
{ 'whmcs' => { 'client_id' => '', 'service_id' => '' } }
- 1 account in CS = 1 account in WHMCS
- When enabling, it will automatically disable user registration. However, you can manually re-enable that.
When generating API Credentials, here are a list of all the required actions:
Billing -> AddBillableItem
Client -> GetClients
Client -> GetClientsDetails
Client -> GetClientsProducts
Products -> GetProducts
Products -> UpdateClientProduct
Servers -> GetHealthStatus
Servers -> WhmcsDetails
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
We use direnv to manage our env file, alternatively you can manually export the variables. See envrc.sample
for details.
Using direnv, you can:
mv envrc.sample .envrc
and adjust accordingly- run
direnv allow .
bundle exec rake test
-
Create cpanel server with hostname:
mycpanelserver.net
-- doesn't have to actually exist. -
Create server group and assign server
-
Create product assigned to previously created server group (under modules)
-
Create user with email [email protected]. Record
userid
asWHMCS_TEST_USER_ID
. -
Add new order for user (skip invoice, emails, etc) and accept order. Set username to
[email protected]
. -
Record
serviceid
in your.env
file forWHMCS_TEST_SERVICE_ID
.
Be sure to delete the billable items after you run the tests. There is no WHMCS api to do that automatically.