Zen Cart
Basics
How do I use PayFast with Zen Cart?
In order to use PayFast with Zencart, you will need to install the PayFast payment module for Zencart which is provided by PayFast.
What are the installation requirements?
- A working Zencart installation
- PHP cURL extension
- Ask your host if you are not sure if this is available
Installation and Testing
How do I install the PayFast module?
To install the PayFast payment module, follow the instructions below:
- Download the payment module from our site
- Unzip the module to a temporary location on your computer
- Copy and paste the files into your Zencart 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
- Login to the ZenCart admin console
- Using the main menu, navigate to Modules → Payment
- Select the “PayFast” payment method by cliking on it
- Click the “Install” button on the right hand pane
- Change the value for “Enable PayFast” to “True”
- Scroll down to the bottom of the right hand pane and press the “Update” button
- 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 indiviudally 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
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:
- Login to the ZenCart admin console
- Using the main menu, navigate to Modules → Payment
- Select the “PayFast” payment method by clicking on it
- Click the “Edit” button on the right hand pane
- Update the configuration values as detailed below:
- Enable PayFast? = True
- Merchant ID = <Your ID as given on https://www.payfast.co.za/acc/integration>
- Merchant Key = <Your Key as given on https://www.payfast.co.za/acc/integration>
- Transaction Server = “Live”
- (Change the other fields as per your preferences)
- Scroll down to the bottom of the right hand pane and press the “Update” button
The module is now ready to receive live payments.
Upgrading
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
- 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
Frequently Asked Questions (FAQs)
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 the MODULE_PAYMENT_PAYFAST_ACCEPTANCE_MARK_TEXT define.
- To change the option entirely, modify the MODULE_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.
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:
- 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 (eg. ZA)
- 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”.
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 save in a PayFast specific table.
If the payment is cancelled during processing on PayFast:
- No order will be created in ZenCart
- 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 ZenCart
- The user will be returned to the Complete page of checkout
Trace: » receiving_email_from_payfast » oscommerce » asp.net » pay_now_buttons » international_payments » payments » security » credit_cards » start » zen_cart


