How do I integrate PayFast with PrestaShop (hosted PrestaShop website)?

How do I integrate PayFast with PrestaShop (hosted PrestaShop website)?

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

To install the PayFast payment module, do the following:

  1. Download the correct version for your PrestaShop installation: v1.5-1.6 or v1.7.*
  2. Unzip the module to a temporary location on your computer.
  3. Copy the modules folder in the archive to your base PrestaShop folder.
    - 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 the instructions below.
    - Using your FTP program, ensure that the /modules as well as /modules/payfast directories are set to CHMOD 0755, otherwise, the validation script will not be accessible to set successful payments as paid.
  4. Delete the install folder in your Prestashop folder.
  5. Log in to the PrestaShop Back Office console.
  6. Using the top navigation bar, navigate to Modules Catalog.
  7. Click Categories and select Other. Alternatively, type PayFast in the search bar and click Search.
  8. Click Install to install the module.
  9. Once the module is installed, click Configure below the PayFast name.
  10. The PayFast options will then be shown, and you will see the module is ready to be tested.
  11. Leave everything as per default and click Save.
  12. Set your shipping/ carrier details to your preferred countries/locations for delivery.
  13. The module is now ready to be tested with the sandbox. To test with the sandbox, use the following login credentials when redirected to the PayFast site:

Copying 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/payfast/config.xml
modules/payfast/logo.gif
modules/payfast/payfast.log
modules/payfast/payfast.php
modules/payfast/payfast.png
modules/payfast/payfast_common.inc
modules/payfast/payfast_payment.tpl
modules/payfast/payfast_success.tpl
modules/payfast/validation.php

Testing that it is working correctly

If you followed the installation instructions above, the module is in 'test' mode and you can test it by purchasing from your site as a buyer normally would. You will be redirected to PayFast for payment and can log in with the user account detailed above and make payment using the balance in their wallet.

You will not be able to directly 'test' a credit card or Instant EFT payment in the sandbox, but you don't really need to. The inputs to and outputs from PayFast are exactly the same, no matter which payment method is used, so using the wallet of the test user will give you exactly the same results as if you had used another payment method.

Going live

In order to make the module 'live', do the following:

  1. Log in to the PrestaShop Back Office.
  2. Using the top navigation bar, navigate to Modules.
  3. Click Payments & Gateways to expand the options.
  4. Under PayFast, click Configure.
  5. In the PayFast Settings block, use the following settings:  
    • Mode = “Live”
    • Merchant ID = <Login to PayFast -> Integration Page>
    • Merchant Key = <Login to PayFast -> Integration Page>
    • Debugging = Unchecked
  6. Click Save.

    • Related Articles

    • How do I integrate PayFast with PrestaShop (PrestaShop Cloud)?

      To install the PayFast payment module, do the following: Download the PayFast addon from the PrestaShop addons site. Navigate to modules in the admin dashboard of your PrestaShop cloud site. Click Add New Module in the top-right corner of the screen ...
    • How do I Integrate PayFast with Simvoly?

      This module was developed by Simvoly, so please visit their website for integration support. You will need to be registered on PayFast to accept payments and get your Merchant ID.
    • How do I upgrade PayFast with PrestaShop?

      To upgrade PayFast with PrestaShop, do the following: Download the payment module from our site. Unzip the module to a temporary location on your computer. Copy the modules folder in the archive to your base PrestaShop folder.
    • Why isn’t my PrestaShop cart being redirected to PayFast?

      Often when the friendly URL’s function is enabled on the PrestaShop installation, some clients reported that the PayFast plugin was broken. The fix for this is to make sure that the permissions on the PayFast module and it’s sub-directories and files ...
    • How do I integrate PayFast with Invoice Ninja?

      To integrate your PayFast account with Invoice Ninja, do the following:   Log in to your Invoice Ninja account. Navigate to Settings > Payment Settings. Click on Configure Gateways. Search for and select PayFast as the Provider. Enter your PayFast ...