Zen Cart

eCommerce shopping cart

Zen Cart

Key Features

  • Open source
  • Free


See PayFast integration

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.

What are the installation requirements?

  • A working Zen Cart installation


How do I install the PayFast module?

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

  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. Login to the Zen Cart admin console
  5. Using the main menu, navigate to Modules ? Payment
  6. Select the “PayFast” payment method by clicking on it
  7. Click the “Install” button 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 press the “Update” button
  10. The module is now operating in “test mode” and is 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:


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 Zen Cart admin console
  2. Using the main menu, navigate to Modules ? Payment
  3. Select the “PayFast” payment method by clicking on it
  4. Click the “Edit” button on the right hand pane
  5. Update the configuration values as detailed below:
    • Enable PayFast? = True
    • Merchant ID = https://www.payfast.co.za/acc/integration>
    • Merchant Key = https://www.payfast.co.za/acc/integration>
    • Transaction Server = “Live”
    • (Change the other fields as per your preferences)
  6. Scroll down to the bottom of the right hand pane and press the “Update” button

The module is now ready to receive live payments.

See Integration and FAQs


Version 1.00 -> 1.01

See “Standard Upgrade Procedure”

Version 1.01 -> 1.02

See “Standard Upgrade Procedure”

Version 1.02 -> 1.03

See “Standard Upgrade Procedure”

Standard Upgrade Procedure
  1. Copy the following files or directories to the base of your Zen Cart installation
    • WARNING: This will overwrite the existing module
    • If you have made any modifications to the PayFast module, you should rather merge your changes into the new files


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.

How do I modify the “look” of the PayFast option on the Payment Information page?

On the Payment Information page (Step 2 of the checkout process), the PayFast option is depicted by a small PayFast logo.

To modify the look of the option, follow these instructions:

  • Open the following file in your installation:/includes/languages/english/modules/payment/payfast.php
    • To add text after the logo, modify theMODULE_PAYMENT_PAYFAST_ACCEPTANCE_MARK_TEXT define.
    • To change the option entirely, modify theMODULE_PAYMENT_PAYFAST_TEXT_CATALOG_LOGO define.
  • Save the file

NB If you upgrade to a new version of the PayFast module at a later stage, your changes will be overridden! So remember to save your changes before doing so.

My customers are getting the error “amount is required”!

Getting the error as detailed below, is most likely due to your currency configuration which is incorrect and the amount is therefore coming through as 0.00.

Error - Amount is required

Our module requires that you use ZAR as your primary currency and that it is configured with the official currency code ZAR (not ZA or some other variation).

Modify this through the Zen Cart admin console on the Localization ? Currencies page. Ensure that you have an entry with the following details:

  • Currency = South African Rand (Default)
  • Code = ZAR
  • Value = 1.00000000

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:

  1. Open this file in your Zen Cart installation:
  2. Find the text:
    $currency = 'ZAR';
  3. Change ZAR to the currency code for your non-standard currency (eg. ZA)
  4. Save the file

This will set the module to use your non-standard currency code.

NB If you upgrade to a new version of the PayFast module at a later stage, your changes will be overridden! So remember to save your changes before doing so.

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 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 Zen Cart folder”.

Directory structure of base Zen Cart folder

What is the payment flow?

PayFast works on browser redirection and will redirect the user to PayFast for payment after they click the “Make Payment” button on the Payment page.

Before the browser is redirected to PayFast, all information concerning the order is saved in a PayFast specific table.

If the payment is cancelled during processing on PayFast:

  • No order will be created in Zen Cart
  • The user will be returned to the “Checkout Payment” (aka “Payment Information”) page of checkout

If the payment is successful during processing on PayFast:

  • An order will be created on Zen Cart
  • The user will be returned to the Complete page of checkout