Difference between revisions of "Testing WHMCS"
(→Testing Modules) |
(→Placing Orders) |
||
Line 18: | Line 18: | ||
==Placing Orders== | ==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 [https://help.whmcs.com/m/installation/l/682009-manually-adding-a-client/ Manually Adding a Client] guide. It's also possible to add clients using the [https://developers.whmcs.com/api-reference/addclient AddClient] API for those with experience | + | 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 [https://help.whmcs.com/m/installation/l/682009-manually-adding-a-client/ Manually Adding a Client] guide. It's also possible to add clients using the [https://developers.whmcs.com/api-reference/addclient 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: |
*[https://docs.whmcs.com/Domain_Pricing Domain Pricing] | *[https://docs.whmcs.com/Domain_Pricing Domain Pricing] | ||
*[https://docs.whmcs.com/Products_and_Services Products and Services] | *[https://docs.whmcs.com/Products_and_Services Products and Services] |
Revision as of 13:07, 12 January 2021
This page details how to test a WHMCS installation before going live, then resetting it ready for production use.
Contents
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 used. 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:
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.
Disabling Outgoing Emails
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:
Orders can then be placed admin side, as an example, these steps would be used to place an order for a domain registration:
- On the Client Summary page, click the "Add New Order" link in the "Actions" panel.
- 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.
- Select None from the Product/Service menu.
- Select Monthly from the Billing Cycle menu for the product section.
- Enter the domain in the Domain textbox and select "Register" as the Domain Registration Option
- 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
Once a payment has been processed against an invoice, the Gateway Log will detail it's result and any support 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 such the invoice (such as the transaction being added).
Finally, should any errors occur with automation, the Module Debug Log will report the request and response sent, 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.