Payment Gateway Charges For WHMCS
Contents |
About Payment Gateway Charges For WHMCS
Payment Gateway Charges For WHMCS allows you to charge additional fees and set up discounts for the usage of a chosen payment gateway. With this module you can easily set products, addons and TLDs that should require an additional fee, and select clients who will be exempt from fees and discounts. |
- Features:
✔ Display Charge Or Discount Rates Depending On Available Gateways |
✔ Display Calculated Rates For Chosen Gateways |
✔ Create Multiple Billing Rules For Gateways |
✔ Copy Existing Rules Between Gateways |
✔ Choose Calculation Method For Charge Or Discount Per Rule: |
✔ Percentage |
✔ Fixed Amount |
✔ Toggle Charging After Tax Application |
✔ Toggle Tax Application To Charge |
✔ Toggle Charging After Promo Code Application |
✔ Set Billing Calculation Methods: |
✔ Standard |
✔ Alternative (e.g. PayPal) |
✔ PayPalV2 |
✔ Create Multiple Steps With Minimum Invoice Value To Apply Fees And Discounts |
✔ Create Multiple Rule Activation Conditions For: |
✔ All Clients |
✔ Chosen Clients |
✔ Chosen Client Groups |
✔ Clients Or Groups With Specific Currencies |
✔ Clients Or Groups With Specific Countries |
✔ Perform Bulk Actions To Mark As Chargeable: |
✔ Clients |
✔ Products |
✔ Addons |
✔ TLDs |
✔ Other: |
✔ Adding Funds To Credit Deposit |
✔ Late Fee Invoice Items |
✔ Custom Invoice Items |
✔ Toggle Visibility Of Charge Rates In Client Area |
✔ Define Charge Format Displayed On Invoice |
✔ Define Div Tag For Custom Order Template Integration |
✔ Access Module Logs |
- Supported Order Form Templates:
✔ Cloud Slider |
✔ Legacy Boxes |
✔ Legacy Modern |
✔ Premium Comparison |
✔ Pure Comparison |
✔ Standard Cart |
✔ Supreme Comparison |
✔ Universal Slider |
✔ Other Custom Templates |
- General Info:
✔ Integrated with Lagom One Step Order Form For WHMCS - Apply Custom Discounts And Fees Based On Payment Gateway Chosen During Ordering |
✔ Supports All Payment Gateways |
✔ Supports Mass Payment Functionality |
✔ Supports Prorata Billing |
✔ Integrated Which All Order Form Templates |
✔ Multi-Language Support |
✔ Supports PHP 7.4 Up To PHP 8.1 |
✔ Supports WHMCS Themes "Six", "Twenty-One" And "Lagom WHMCS Client Theme" |
✔ Supports WHMCS V8.4 And Later |
✔ Requires ionCube Loader V12 Or Later |
✔ Easy Module Upgrade To Open Source Version |
Installation
This tutorial will show you how to successfully install and configure Payment Gateway Charges For WHMCS. We will guide you step by step through the whole installation and configuration process. |
1. Log in to our client area and download the module. |
2. In the downloaded file you might find one or two packages that support different PHP versions. In the most recent versions of the module, you will find only one package that supports PHP 7.2 and later. |
Previous updates of the module may contain two packages dedicated to various PHP versions. The first one that supports PHP 5.6 up to PHP 7.1, and the second one addressed to PHP 7.2 up to PHP 7.4. |
Note: You can check the current PHP version in your WHMCS. To do so, proceed to 'Utilities' → 'System' → 'PHP Info'. |
3. Extract the package and upload its content into the main WHMCS directory.
The content of the package to upload should look like this. |
4. When installing Payment Gateway Charges For WHMCS for the first time, you have to rename the 'license_RENAME.php' file. The file is located in 'your_whmcs/modules/addons/PaymentGatewayCharges/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'. |
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'. |
6. Now, set up the 'storage' folder as recursively writable. This folder is available at 'your_whmcs/modules/addons/PaymentGatewayCharges/' . |
7. Now you have to activate the module in your WHMCS system. Log in to your WHMCS admin area. Go to 'Setup' → 'Addon Modules'. Afterwards, find 'Payment Gateway Charges' and press the 'Activate' button. |
8. In the next step you need to permit access to this module. To do so, click on the 'Configure' button, tick 'Full Administrator' and press 'Save Changes'. |
9. Congratulations, you have just successfully installed Payment Gateway Charges For WHMCS! You can now access your module from 'Addons' → 'Payment Gateway Charges'. |
Configuration and Management
Payment Gateway Charges For WHMCS allows your customers to manage additional charges in your WHMCS system. In this short guide we will present you the possibilities of our module. |
Gateways Settings
Once you access the addon, you will be moved directly to its configuration. Here you can decide for which gateways the additional charges or discounts will be applied, according to their settings and rules. Start by selecting 'Settings' . |
Here you can define the following settings:
|
'Charge After Taxing' and 'Apply Tax To Charge' explanation:
The 'Charge After Taxing' and 'Apply Tax To Charge' options are disabled.
The charge with enabled option 'Charge After Taxing' and disabled option 'Apply Tax To Charge' .
The 'Charge After Taxing' and 'Apply Tax To Charge' options are enabled.
The charge with enabled option 'Apply Tax To Charge' and disabled option 'Charge After Taxing' . |
Billing types explanation:
Note: when one of these PayPal methods is selected, then this billing type will be applied to every activated payment gateway, not only PayPal. |
Let's see how the 'Standard' and 'Alternative (e.g. PayPal model)' calculation methods differ in practice. Please notice at the table below that the final price which a client is obliged to pay and the amount that will be sent e.g. to PayPal slightly vary between the two presented methods. |
E.g.:
|
So, the total amount to be paid by the client would be $130.20 for the standard method and $130.53 for the alternative, PayPal method.
Now, let us see in reverse how these total fee amounts would look like if both were the result of calculations using an alternative method only. |
|
So, if you are using PayPal and want to receive a full $124.00 amount for a product with a 5% gateway fee, a payment of $130.53 should be sent to PayPal gateway. $6.53 will cover PayPal fees which is 5% of the total amount to be paid by the client. In case of the $130.20 amount calculated using the standard method, the 5% PayPal fee would be $6.51, which, after deducting from the total, would result in $123.69 amount for the product itself. |
|
Gateways Rules
|
In the rules section, you can set a percentage or a fixed amount of billed charges or discounts. To set the rules, first press 'Show Rules' located next to the chosen payment gateway. |
Next, press the 'Add Rule' button. |
Here you can name the rule and define a charge for the gateway in a percent form, fixed amount or both. |
Important: At least one gateway condition must be added to the rule for it to work. You can find a description of adding conditions to rules here. The following examples assume that gateway conditions have already been created. The result of the above rule will be a 5% charge of the product price (which in this example is $100.00) with additional $1.00 charge for the selected 2Checkout payment gateway (using 'Standard' billing type method). |
You can also set negative amounts. Then, a discount will be applied to a chosen gateway instead of charging an additional fee. |
The result of the above rule will be a 5% discount of the product price (which in this example is $100.00) with additional $1.00 reduction for the selected 2Checkout payment gateway (using 'Standard' billing type method). |
Steps Rules
You can also add additional steps to your rules and define above which minimum amount on the invoice the additional fee or set discount will be applied. To start, press 'Show Steps' next to the created rule. |
Now, you need to add your first step. Press the 'Add Step' button. |
To create a rule, enter the percentage or fixed amount of the desired charge or discount. Then, specify the minimum required amount that will trigger the rule. |
You can create as many steps as you want. Each of these step rules will be activated only after the minimum invoice amount has been achieved. Note that only one step rule can be active at a time. Also, if none of the step rules is met, then the main rule created in the previous section will be applied. In this example, it is the rule for orders below $50.00 amount. |
Gateways Conditions
You can also specify multiple conditions that will affect activation of the rule. Note that at least one condition has to be created to make the rule applicable. Start by choosing the 'Show Conditions' button next to the selected rule. |
There is one default condition that has been created when adding the first gateway. You may modify it, delete and create new conditions here. |
Press the 'Add Condition' button to create a new condition within this gateway. |
You can select one of several conditions that will determine the activation of the rule. Choose between the following types:
|
Important: some conditions may be combined with one another to provide more possibilities for triggering the rule, but they should not overlap. If you encounter a validation error when adding a condition, make sure that there are no conflicts with conditions configured under this or other rules. |
Once you have ready rules and conditions prepared per gateway, you may either configure them per every existing gateway or simply copy all the settings to another gateway. Press the marked button and then select from which gateway you want to copy the rules together with its steps and conditions. Note: Keep in mind that if there were any rules in the gateway, all of them will be removed and overwritten by the new, copied settings. |
Management of Items
To enable or disable gateway charges and discounts for products, addons or TLDs, go to the 'Items' section. Then, select the category of items and simply toggle the 'chargeable' status next to the selected item. Note: For convenience, all new and already existing items are set to 'chargeable' by default. |
You can also toggle multiple 'chargeable' statuses at once by selecting items and using bulk action. |
Other Options
Enable or disable gateway charges and discounts for selected options
Note: Again, all available options are set to 'chargeable' by default. |
You can also toggle multiple 'chargeable' statuses at once by selecting items and using bulk action. |
Management of Clients
To enable or disable gateway charges and discounts for your customers, go to the 'Clients' section. Then, simply toggle the 'chargeable' status next to the selected client. Note: For convenience, all new and already existing clients items are set to 'chargeable' by default. |
You can also toggle multiple 'chargeable' statuses at once by selecting clients and using bulk action. |
Settings
In this section you can customize the basics of the module's settings such as:
|
Logs
In the logs section you can see which invoices have been calculated with additional discounts or charges resulting from the module's configuration. |
Note that you can also delete multiple logs at once. |
Custom Template Integration
To add an integration to your custom template, first you need to choose the place where you want the charges table to be placed. It is recommended to position it under a unique tag, e.g.: div#a_unique_element_in_which_the_table_will_be_located Now, go to the module settings and select 'Use Charges Table Tag' from the 'Select Template' dropdown menu. |
Next, you need to learn the name of your custom orderform template. Note that you can find all orderforms templates in 'yourWHMCS/templates/orderforms/' location. For this example we will assume that your custom oderform template is simply named as 'custom_template' .
1. The code between lines 10-19 to update the charge values: {/literal}{elseif $template eq 'custom_template'}{literal} $('div#where_the_charge_price_value_is_replaced').html(data.data.string); 2. The code between lines 42-75 provides you with a possibility to define table display: {/literal}{elseif $template eq 'custom_template'}{literal} $('input[name=applycredit]').on('change', function(event){ // event to check if the 'Apply Credit' value has been changed mgLoadCharge(); }); $('input[name=paymentmethod]').on('change', function(event){ // event to check if the 'Payment Method' has been changed mgLoadCharge(); }); $('select[name=country]').on('change', function(event){ // event to check if the 'Country' value has been changed mgLoadCharge(); }); After completing this procedure and applying the right code, you should have a working layout in your client area. |
Tips
1. For your convenience, payment gateway charges are enabled by default for clients, products, addons and domains. |
2. Taxes will not be applied to gateway discount rules even if 'Apply Tax To Charge' option is enabled. |
3. You can easily change all names of module elements displayed in the client area, admin area or invoices in a language file. To do so, go to the 'your_whmcs/modules/addons/PaymentGatewayCharges/langs' directory, open the language file (e.g. english.php) and edit desired records. |
4. In case there is more than one rule that matches a single client, the one with the most precise conditions, concerning that client, will be taken into account when calculating the final discount. |
5. If you have installed the Lagom WHMCS theme, use the following 'Charges Table Tag' for the custom template integration:
div#paymentGatewaysDetails |
6. If you are an experienced administrator, you may take advantage of an extra (hidden) tab 'Debug Logs'. See details of performed calculations with information on used conditions and the 'before' and 'after' prices. In order to enter the debug logs section, you need to manually add to 'your_whmcs/your_admin_path/' URL: addonmodules.php?module=PaymentGatewayCharges&mg-page=DebugLogs |
7. Note that you may always change the default translations to more friendly names. Just open the english.php file, find lines: $_LANG['InvoiceItemTextCharge'] = 'Payment Gateway Charge'; $_LANG['addonCA']['charge']['chargeCheckout'] = 'Gateway Charge'; $_LANG['addonCA']['charge']['discountCheckout'] = 'Gateway Discount'; $_LANG['addonCA']['charge']['paymentGatewayCharges'] = 'Payment Gateway Charges'; and change the content here: ='your_friendly_name' in any of the above if you only wish. |
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! |
Migration
Note that while using the 1.X version of our module, no data can be migrated. This is due to the fact that we did not implement the migration from any of the previous versions of Payment Gateway Charges, so the module needs to be configured from scratch. Note: Remember that if you wish to switch to the latest version, you need to reissue your license first. |
Common Problems
1. When you have problems with connection, check whether your SELinux or firewall does not block ports. |
2. In the current version, if a promotional code is used by the client, the amount of charge will not be changed as it will continue to be calculated from the basing item price. The ability to recalculate the charge after using a promo code will be restored in future versions. |
3. In case none of your payment gateways is visible on the list, make sure that collations in the database are correctly configured. For more information on collations please refer to the WHMCS official documentation, point: 'Database Collations'. |
4. We do not recommend using Payment Gateway Charges For WHMCS with the Resellers Center For WHMCS module due to the fact that both of these modules manipulate with the invoices which cause serious conflicts. |