Difference between revisions of "Testing WHMCS"

From WHMCS Documentation

m (Testing Modules)
m (Testing Modules)
Line 8: Line 8:
 
[[File:Enom-test-mode.png|800px]]
 
[[File:Enom-test-mode.png|800px]]
  
When testing provisioning modules, there is no test mode required, however, it is advisable that all actions be reversed, as not only does this tidy things up, it tests that action as well. An example of this would be provisioning a cPanel account on a remote server, then using the Terminate module command button to remove it.
+
When testing provisioning modules, there is no test mode required. It is however advisable that all actions be reversed, as not only does this tidy things up, it tests that action as well. An example of this would be provisioning a cPanel account on a remote server, then using the Terminate module command button to remove it.
  
 
==Disabling Outgoing Emails==
 
==Disabling Outgoing Emails==

Revision as of 12:16, 17 January 2021

This page details how to test a WHMCS installation before going live, then resetting it ready for production use.

Testing Modules

WHMCS shipped registrar and gateway modules come with, where possible, a test mode or the ability to use a test environment that can be utilised to test transactions and domain orders. Referring to our documentation for the module being used will detail how test mode can be enabled. For example, with the eNom registrar module, this is detailed here: https://docs.whmcs.com/Enom#Test_Mode

An example of enabling test mode in the eNom module can be seen here:

Enom-test-mode.png

When testing provisioning modules, there is no test mode required. It is however advisable that all actions be reversed, as not only does this tidy things up, it tests that action as well. An example of this would be provisioning a cPanel account on a remote server, then using the Terminate module command button to remove it.

Disabling Outgoing Emails

Disable Email Toggle
When testing, it is desirable in most cases (unless the test is specific to receiving emails) to prevent WHMCS from sending emails. To achieve this, navigate to Configuration () > System Settings > Mail tab and toggle the Disable Email Sending option to "On".

Disabling emails is a feature available in WHMCS 8.1 or above.

Placing Orders

Once you have configured your required modules in test mode, as detailed above, you will want to place test orders. To place test orders within the admin user interface, you will want to first create a client/account. Details on how to do this can be found in the Manually Adding a Client guide. It's also possible to add clients using the AddClient API for those with PHP experience. Ensure that the relevant domain or product pricing is configured before proceeding with testing orders. More information on that can be found here:

Admin Order Form

Orders can then be placed admin side, as an example, these steps would be used to place an order for a domain registration:

  1. On the Client Summary page, click the "Add New Order" link in the "Actions" panel.
  2. The system will preselect the client. Fill out the rest of the form, beginning with choosing the payment gateway you want their future invoices to use.
  3. Select None from the Product/Service menu.
  4. Select Monthly from the Billing Cycle menu for the product section.
  5. Enter the domain in the Domain textbox and select "Register" as the Domain Registration Option
  6. Choose the number of years you want to invoice the client for at the time of renewal.

WHMCS will only ever trigger a registration request for a domain name when the invoice for it is paid. For products, please refer to the Modules Settings to see how WHMCS handles this.

Orders can also be placed by using the Login as Owner function to see the workflow a customer would see.

Processing Transactions

Once you have an invoice you wish to test payment on, you will want to do so according to the documentation for the gateway module(s) you are using. An example of a difference would be, PayPal Checkout requires you to login as a client/user and make payment from the client area, by selecting the invoice itself, where as Stripe would require a stored card/pay method for the invoice to be captured against. Please see Pay Methods for more information.

Checking Automation

Gateway Log

Once a payment has been processed against an invoice, the Gateway Log will detail it's result and any supporting data you require to validate success.

In respect of domain names and provisioning modules, the Activity Log will record success or failure so you are aware of whether the expected automation actions have completed. The Activity Log will also record successful details from the payment applied to the invoice (such as the transaction being added).

Finally, should any errors occur with automation, the Module Debug Log will report the request sent and response received, allowing you to determine the issue and resolve it.

Resetting Your Database

After you successfully install your billing system, run through a series of tests, including creating client accounts and placing test orders with your particular setup. Often, after you have finished your testing, you will no longer want any of these clients or orders in your system. All you need to do is reset your system, which will remove all of your test accounts.

You can empty all the tables that contain clients' data by running the following SQL code on your database:

TRUNCATE `mod_invoicedata` ;
TRUNCATE `tblinvoicedata` ;
TRUNCATE `tblaccounts` ;
TRUNCATE `tblactivitylog` ;
TRUNCATE `tblaffiliates` ;
TRUNCATE `tblaffiliatesaccounts` ;
TRUNCATE `tblaffiliateshistory` ;
TRUNCATE `tblaffiliatespending` ;
TRUNCATE `tblaffiliateswithdrawals` ;
TRUNCATE `tblbankaccts`;
TRUNCATE `tblbillableitems` ;
TRUNCATE `tblcancelrequests` ;
TRUNCATE `tblclients` ;
TRUNCATE `tblclientsfiles` ;
TRUNCATE `tblcontacts` ;
TRUNCATE `tblcredit` ;
TRUNCATE `tblcreditcards`;
TRUNCATE `tblcustomfieldsvalues` ;
TRUNCATE `tbldomains` ;
TRUNCATE `tbldomainsadditionalfields` ;
TRUNCATE `tblemails` ;
TRUNCATE `tblhosting` ;
TRUNCATE `tblhostingaddons` ;
TRUNCATE `tblhostingconfigoptions` ;
TRUNCATE `tblinvoiceitems` ;
TRUNCATE `tblinvoices` ;
TRUNCATE `tblmodulequeue` ;
TRUNCATE `tblnotes` ;
TRUNCATE `tblorders` ;
TRUNCATE `tblpaymethods`;
TRUNCATE `tblquotes` ;
TRUNCATE `tblquoteitems` ;
TRUNCATE `tblsslorders` ;
TRUNCATE `tblticketlog` ;
TRUNCATE `tblticketnotes` ;
TRUNCATE `tblticketreplies` ;
TRUNCATE `tbltickets` ;
TRUNCATE `tblupgrades` ;
TRUNCATE `tblusers`;
TRUNCATE `tblusers_clients`;
TRUNCATE `tbluser_invites`;

Note
Resetting your database only deletes client accounts and information. You will not lose any configuration or product settings.