How do I integrate PayFast with Zen Cart?

How do I integrate PayFast with Zen Cart?

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

Installation requirements

  • A working Zen Cart installation

Installation and testing

To install the PayFast payment module, do the following:

  1. Download the payment module from our site.
  2. Unzip the module to a temporary location on your computer.
  3. Copy and paste the files into your Zen Cart installation as they were extracted.
    • 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. Log in to the Zen Cart admin console.
  5. Using the main menu, navigate to Modules > Payment.
  6. Select the PayFast payment method.
  7. Click Install on the right-hand pane.
  8. Change the value for Enable PayFast to True.
  9. Scroll down to the bottom of the right-hand pane and click Update.
  10. The module is now operating in 'test mode' and is ready to be tested with the PayFast 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:

payfast_itn_handler.php
admin/payfast.php
admin/includes/boxes/extra_boxes/payfast_customers_dhtml.php
admin/includes/languages/english/payfast.php
includes/auto_loaders/payfast_itn.core.php
includes/init_includes/init_payfast_itn_postcfg.php
includes/init_includes/init_payfast_itn_sessions.php
includes/languages/english/modules/payment/payfast.php
includes/modules/payment/payfast.php
includes/modules/payment/payfast/payfast_functions.php
includes/modules/payment/payfast/payfast_common.inc

Going live

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

  1. Log in to the Zen Cart admin console.
  2. Using the main menu, navigate to Modules > Payment.
  3. Select the PayFast payment method.
  4. Click Edit on the right-hand pane.
  5. Update the configuration values as detailed below: 
  6. Scroll down to the bottom of the right-hand pane and click Update.

The module is now ready to receive live payments.


    • Related Articles

    • How do I integrate PayFast with CS-Cart?

      You’ll need a working installation of CS-Cart before you can integrate with PayFast. Kindly see their website for more information. Installation and testing V4 To install the PayFast payment module, do the following: Download the payment module. ...
    • How do I integrate PayFast with VP-CART?

      This module was developed by VP-CART, so please visit their website for integration support. You will need to be registered on PayFast to accept payments and get your Merchant ID. Installation Instructions For installation, you can find the full ...
    • How do I integrate PayFast with Shopping Cart Elite?

      This module was developed by Shopping Cart Elite, so please visit their website for integration support. You will need to be registered on PayFast to accept payments and get your Merchant ID.
    • In Zen Cart I’m using a non-standard currency code. Can I change your module to use it?

      While we don’t recommend this at all, you can do this as follows: Open this file in your Zen Cart installation: /includes/modules/payment/payfast.php Find the text: $currency = 'ZAR'; Change ZAR to the currency code for your non-standard currency ...
    • Where is my "base Zen Cart folder"?

      This is the root of your Zen Cart 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 Zen Cart directory structure. The base (or root) Zen Cart ...