WHMCS

WHMCS is an all-in-one client management, billing & support solution for online businesses

Key Features

  • Professional billing & invoices
  • Automation
  • Product management
  • Reports & statistics

Integration

See PayFast integration

How do I use PayFast with WHMCS?

In order to use PayFast with WHMCS, you will need to install the PayFast payment module for WHMCS which is provided by PayFast.

What are the installation requirements?

  • A working WHMCS installation

INSTALLATION AND TESTING

How do I install the PayFast module?

To install the PayFast payment module, follow the instructions below:

  1. Download the WHMCS payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. Copy the “modules” folder from the archive to your base “whmcs” folder (using FTP program or similar)
    • This should NOT overwrite any existing files or folders and merely supplement them with the PayFast files
    • This is however, dependent on the FTP program you use
    • If you are concerned about this, rather copy the individual files across as per instructions below
  4. Login to the WHMCS Administrator console
  5. Using the main menu, navigate to Setup ? Payment Gateways
  6. Select “PayFast” from the “Activate Gateway” drop-down list and click “Activate”
  7. Enter the following details under the “PayFast” heading:
    • Merchant ID = <Integration page>
    • Merchant Key = <Integration page>
    • Test Mode =
  8. Click “Save Changes”
  9. The module is now and ready to be tested with the Sandbox. To test with the sandbox, use the following login credentials when redirected to the PayFast site:
    • Username: sbtu01@payfast.co.za
    • Password: clientpass

How do I copy the individual files across?

If you are concerned that copying the entire folder from the downloaded module may overwrite files in your installation, rather copy the files from the extracted module individually into your installation.

Be sure to copy the files from the downloaded module to their corresponding locations within your installation:

The list of files needed in your online installation is as follows:

modules/gateways/payfast.log
modules/gateways/payfast.php
modules/gateways/payfast_common.inc
modules/gateways/callback/payfast.php

How can I test that it is working correctly?

I’m ready to go live! What do I do?

In order to make the module “LIVE”, follow the instructions below:

  1. Login to the WHMCS Administrator console
  2. Using the main menu, navigate to Setup -> Payment Gateways
  3. Under the “PayFast” heading, uncheck the “Test Mode” item
  4. Click “Save Changes”

See Upgrading and FAQs

UPGRADING

Version 1.00 -> 1.10

See “Standard Upgrade Procedure”

Standard Upgrade Procedure
  1. Download the WHMCS payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. Copy the “modules” folder from the archive to your base “whmcs” folder (using FTP program or similar)
    • This should should ONLY overwrite existing PayFast files
    • This is however, dependent on the FTP program you use
    • If you are concerned about this, rather copy the individual files across as per instructions below
  4. Login to the WHMCS Administrator console
  5. Using the main menu, navigate to Setup -> Payment Gateways
  6. Enter the following details under the “PayFast” heading:
    • Merchant ID = <Integration page>
    • Merchant Key = <Integration page>
  7. Click “Save Changes”

FREQUENTLY ASKED QUESTIONS (FAQS)

I’m getting a signature mismatch error, why?

If you are using a WordPress installation along with a WHMCS bridge plugin, the cause is that the WordPress plugin modifies the output of the values sent through to PayFast. In order to fix this, you need to comment out the signature generation part of a file located with your WHMCS modules folder. Got to file, /modules/gateways/payfast.php, around line 125, comment out the following line:

//$data['signature'] = md5( $secureString );

Do I need to set the ITN url on my account?

No. When using the one of our payment modules, the ITN url is set automatically and you do not need to set it on your account manually.

I get an “invalid url” error message when being redirected to PayFast!

This is due to one of 2 reasons: you are testing from a non internet accessible machine (eg. a local development machine) or you have not setup your URLs in WHMCS correctly.

Non internet accessible machine

The module will only perform as expected if you are testing from an internet accessible machine (eg.http://www.mydomain.co.za). It will not work from something like http://localhost orhttp://my.machine.local.

Ensure that you are testing on an internet accessible machine.

URLs not setup correctly

Many components in the system, including our module, make use of the System URL to generate URLs required.

Navigate to the General tab in the WHMCS admin console and ensure that you have set up all your URLs correctly.

The “payment status” for my orders is not being automatically updated!

This is most likely due to the fact that the PayFast ITN callback file is not able to be called.

Check file permissions

Ensure that the file permissions of the callback file (/modules/gateways/callback/payfast.php) are set to 644. Setting the permissions differently (e.g. 777) may result in the web server not allowing the file to be called due to security restrictions.

Where is my “base WHMCS folder”?

This is the root of your WHMCS installation. Where this is, depends on what system you are using and where you are hosting.

The easiest way to find this though would be to look for the WHMCS directory structure.

The base (or root) WHMCS folder will look similar to the image shown below.

Simply find the folder in your installation which looks similar to this structure and that will be your “base WHMCS folder”.

Directory structure of base WHMCS folder

USEFUL LINKS