vteam #240 is working on a self service commerce platform, using WHMCS.
The application lets customers create online stores on our platform, customer signs up with specific package i.e. domain, sub domain with some specific disk space and bandwidth. As customer goes through checkout process, a specific disk space and bandwidth is allocated to that user based on package selected. On other hand, the application is also deployed on customer domain as a complete store, customer can login using same information used at signup process and start setting up store i.e. creating products, publishing pages etc.
WHMCS Integration with our Application:
Using WHMCS admin panel, we need to add server username, password, host name and IP. Also place a copy of our application on that server.
WHMCS provides different triggers/hooks for different levels of signup process. i.e. hook_account_create, hook_account_edit, hook_login, hook_logout, hook_order_create, hook_order_accept .
We can write our PHP code in these hooks to execute as hook is called; for that we create a module for WHMCS with hooks file. All hooks with our code are defined in that hooks file. As an event occurs WHMCS calls hook of our module and it executes our code.
To communicate with our application we have created a REST API that provides following services:
- Create Customer
- Create Store:
- Create Database
- Upload theme
- Install default store settings
When hook_account_create triggers, it calls our application API and creates a customer on our application as well.
On order acceptance order_accept_hook is called, it executes our code which communicates with our application to setup a store and create database.
Customer places order on WHMCS → WHMCS calls its hook → hooks executes our code → our code calls REST API of our application → rest of the work is done by our application i.e. creating database, deployment settings and uploading themes.
An email is sent to customer with link and details as process is completed. Customer clicks on the domain link to visit the running store.
vteam #240 is working with the Client in developing his product since last 2.5 years. Client’s product is going to be launched now. In the last phase of product development, vteam #240 used WHMCS tool for Product’s server resource management and hosting plans. vteam #240 explored this approach of WHMCS and implemented it in Billing Automation. In Client’s product, vteam #240 used WHMCS in:
- Defining product packages on the basis of Disk Storage & Bandwidth
- Sell out packages including hosting plans
- Customers domain management
- Payment Integration