Personal tools
Namespaces

Variants
Actions

G Suite For WHMCS

From ModulesGarden Wiki
Jump to: navigation, search


Contents

About G Suite For WHMCS

G Suite For WHMCS will enable all G Suite Authorized Resellers to provision and manage Google accounts in their very own WHMCS system.

Authenticate through OAuth 2.0, create flexible products and let your clients order ready Google services directly from your website.

  • Admin Area Features:
✔ Create/Suspend/Unsuspend/Terminate Account
✔ Change Package
✔ Choose Plan Name
✔ Choose Renewal Type
✔ Choose Action On Termination
✔ Log API Requests
✔ Automatically Create Administrator Account
✔ Set Administrator Mailbox Name
✔ Set Configurable Options Per Product:
✔ Product SKU ID
✔ Number of Seats
  • Client Area Features:
✔ View Customer Info
✔ Log In To Control Panel
✔ Log In To Webmail
  • Available Google Services:
✔ G Suite Basic
✔ G Suite Business
✔ G Suite Enterprise
✔ Google Vault
✔ Google Drive Storage
  • General Info:
✔ Requires G Suite Partner Program / Reseller Account
✔ Authentication And API Calls Utilize OAuth 2.0
✔ Multi-Language Support
✔ Supports PHP 5.6 Up To PHP 7.2
✔ Supports WHMCS Template Six
✔ Supports WHMCS V7

Installation and Authentication

This tutorial will show you how to successfully install and authenticate G Suite For WHMCS.

We will guide you step by step through the whole installation and authentication process.

1. Log in to our client area and download the module.
GA1.png
2. In the downloaded file you will find two packages that support different PHP versions.
As presented on the screen below, the first one is dedicated to PHP 5.6 up to PHP 7.0, while the second one is aimed at PHP 7.1 up to PHP 7.2.
It does not apply to open source versions.

Note: You can check the current PHP version in your WHMCS. To do so, proceed to 'Utilities' → 'System' → 'PHP Info'.

PHP56 72.png
3. Extract the downloaded file and choose the one with the right PHP version. Upload and extract the PHP file into the main WHMCS directory.

The content of the PHP version files should look like this.

Ftgt.png
4. When you install G Suite For WHMCS for the first time, you have to rename the 'license_RENAME.php' file.

The file is located in 'modules/servers/gSuite/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'.

GA3.png
5. In order to configure your license key you have to edit the previously renamed 'license.php' file.

Enter your license key between the quotation marks as presented on the following screen. You can find your license key in our client area → 'My Products'.

GA4.png

API Configuration

6. Now you have to authenticate the module through setting up the API Access.

Create API Access in Google Console. You can do it here → https://code.google.com/apis/console/

7. After you have logged in, create a new project.
GA5.png
8. The Google API Manager window should open. To start with, go to 'OAuth consent screen' under the 'Credentials' section.

Afterward, enter the mail address and product name that will be visible during your requests.
Save changes through pressing the 'Save' button.

GA5 1.png
9. To proceed, go to 'Google APIs' under the 'Overview' tab.

Find 'Google Apps Reseller API' among the applications.

GA5 2.png
10. Now, you have to enable 'Google Apps Reseller API' as shown on the following screen.
GA5 2.1.png
11. Then, switch to the 'Credentials' tab and add new credentials .
GA5 4.png
12. After you have done that, tick 'Web application'.

Next, enter your website URL into the 'Authorized JavaScript origins' field and correct path to 'oauth_callback.php' into the 'Authorized redirect URI' field.
Confirm changes through pressing 'Create'.

GA5 5.png
13. Well done! Now that you have filled in all the necessary details, you can proceed to authenticate Google Apps.
GA5 6.png

Product Configuration

14. Go back to your WHMCS system and create a new product for your GoogleApps.

Move to 'Setup' → 'Products/Services' → 'Products/Services' and add a new product.

GA5 6 1.png
15. Choose the desired product type and product group from the dropdown menus and enter a new name of your products. Press 'Continue'.
GA5 6 2.png
16. Go to 'Module Settings' of your product and choose 'G Suite' from the 'Module Name' dropdown menu.

After choosing the module, make sure to click on the 'Save Changes' button.

GA5 7.png
17. Enter your previously obtained 'Client ID' as well as 'Client Secret' and make sure that 'Callback URL' is correct.

Then, press 'Grant access with Google account'.

GA5 8.png
18. If the data you entered is correct, you will be redirected to the page with permission request. Press the 'Allow access' button.
GA5 9.png
19. That is it. You will be now redirected to your WHMCS and you will see the following screen.
GA214.png
20. Now, let us move to 'Custom Fields'. Fields with 'GoogleApps Domain' , 'GoogleApps PurchaseOrderID' , 'GoogleApps Alternate Email' and 'Mailbox Name' variables are added automatically.

Note: Since 1.3.0 module version you are free to adjust the 'friendly' name part after |, but remember not to change the first part, which is a variable.

GA19.png

Configuration and Management

Configuration and management of G Suite For WHMCS is very intuitive. Read the below sections to see how easy it is.

Basic Configuration

Let us begin the process of module configuration by choosing Default Product SKU ID. To start with, simply pick one of the available Google services.

As you can see on the following screen, our module supports G Suite Basic, G Suite Business and G Suite Enterprise, as well as Google Drive Storage and Google Vault.

GA216.png
Plan Name allows you to select the method of payment. You can choose between:
  • ANNUAL - the annual commitment plan with monthly payments
  • ANNUAL_YEARLY_PAY - the annual commitment plan with yearly payments
  • FLEXIBLE - monthly billing for the number of user accounts used in a particular month
  • TRIAL - the 30-day free trial plan

Note: Since the 1.1.5 version of G Suite For WHMCS module, the ANNUAL plan is equivalent to ANNUAL_MONTHLY_PAY in G Suite API.

GA217.png
Rennewal Type - choose the method of renewing your plan when the current subscription expires. The available options are:
  • AUTO_RENEW_MONTHLY_PAY - at the end of the interval of annual commitment plan, automatically renew the subscription plan with monthly payments and with the same number of user licenses
  • AUTO_RENEW_YEARLY_PAY - at the end of the interval of annual commitment plan, automatically renew the subscription plan with yearly payments and the same number of user licenses
  • CANCEL - at the end of the interval of annual commitment plan, suspend the customer's account
  • RENEW_CURRENT_USERS_MONTHLY_PAY - at the end of the interval of annual commitment plan, renew the subscription plan with monthly payments but use the total number of current active user licenses
  • RENEW_CURRENT_USERS_YEARLY_PAY - at the end of the interval of annual commitment plan, renew the subscription plan with yearly payments but use the total number of current active user licenses
  • SWITCH_TO_PAY_AS_YOU_GO - at the end of the interval of annual commitment plan, change the annual commitment plan to a flexible plan
GA17 1.png
Action On Terminate - here you can decide whether you want to suspend or cancel customer services upon the termination.
GA218.png
Create Admin Account & Mailbox Name - select this option to automatically create an administrator account with a given username for the G Suite domain.
GA218 2.png

Configurable Options

In order to automatically generate configurable options, simply press the button marked on the screen.
GA221.png
In your WHMCS system press 'Setup' 'Products/Services' 'Configurable Options'.

Find the 'GoogleApps' options on the list.

GA22.png
Here you can manage and alter added configurable options.
GA223.png
Provide values for your new option and enter the desired price. Press 'Save Changes'.
GA24.png
In the 'Module Settings' tab of your product you can fill out the fields for ' Default Product SKU ID' and 'Default Number of Seats.
Remember however that these values will be used only if configurable options are NOT generated.
GA225.png
From now on you can easily and quickly change value of your product. Remember that you can add more configurable options for other values.

Admin Area

Let us check your new product on the product page in admin area. It should look like on the screen below.
GA19.1.png

Client Area

This is how the module will be displayed in the client area. G Suite For WHMCS also allows your customers to quickly access Google account services.
GA20.png

Update of Existing Customers

You can link existing customer accounts by filling in the Custom Fields: 'GoogleApps Domain' and 'GoogleApps PurchaseOrderID'.

After your customers order a new subscription, they should insert their primary Google account domain name in the 'GoogleApps Domain' field.
Then, the new subscription will be added to that account.
If you want to manually create an order for existing subscription, in addition to the above steps, you need to find 'Purchase Order ID' (usually on the invoice).
Copy the ID and paste it to the 'GoogleApps PurchaseOrderID ' field.
Afterward, do not run the create command but just press the 'Save Changes' button. You can also change the status to 'Active'.

GA28.png

Tips

1. Our module requires a G Suite Reseller account.
2. Avoid using localhost and Raw IP during the authorization.
3. Callback URL is fetched from your WHMCS System URL. You can set it in the 'General Settings' of your system.
4. To change your API access and OAuth, go to product configuration page and add &logout=1&revoke=1 to the URL.
Example:
http://yourwebsite/whmcs/admin/configproducts.php?action=edit&id=28&logout=1&revoke=1
5. If you want to better understand the concept of G Suite Reseller API and our module, visit this page
6. Some API actions such as 'suspend' may be subject to additional restrictions or have different results depending on the selected plan or the number of days elapsed.
You can learn more about them here.

Update Instructions

Essential guidance through the process of updating the module is offered here.

Keep in mind there is a quick and easy option in our client area that will let you upgrade the license of your module to an open source version at any time - and at a lower price!
To take advantage of it, simply use the License Upgrade button located on the product's page and a discounted invoice will be generated automatically.

Common Problems

1. When you have problems with connection, check whether your SELinux or firewall does not block ports.
2. It is possible to receive such an error while authenticating our module:
Error: redirect_uri_mismatch

If such a case, make sure that URLs provided in Google account and your WHMCS system are the same.
Keep in mind that addresses with the prefix 'www' vary from addresses without this prefix.

3. In case you encounter error similar to the one below, you most probably disabled the output buffering in the PHP configuration.
Notice: ob_clean(): failed to delete buffer.

To solve the problem, please set the 'output_buffering' value to 'On' in the php.ini file.

Navigation
WHMCS Modules
cPanel Modules
Magento Extensions
Magento Themes
PrestaShop Modules
Blesta Extensions
General
Social
G Suite For WHMCS