VirtueMart

VirtueMart

Basics

How do I use PayFast with VirtueMart?

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

What are the installation requirements?

  • A working Joomla and VirtueMart 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?

VirtueMart 1.0

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

  1. Unzip the module to a temporary location on your computer
  2. Copy the “administrator” folder in the archive to your base “joomla” 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 instructions below
  3. Login to the Joomla Administrator console
  4. Using the main menu, navigate to Components → VirtueMart
  5. Using the VirtueMart menu, navigate to Store → Add Payment Method
  6. Enter the following details in the “Payment Method Form” tab:
    • Active? = <checked>
    • Payment Method Name = “PayFast”
    • Code = “PF”
    • Payment class name = “ps_payfast”
    • Payment method type = “PayPal (or related)”
    • (Leave all other fields as they are)
  7. Click Save
  8. Click on the newly added “PayFast” method in the payment methods list
  9. Click on the Configuration tab
  10. Copy the contents of the “payment_extra_info.php” file into the “Payment Extra Info” field
  11. Click Save
  12. 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

VirtueMart 1.1

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

  1. Unzip the module to a temporary location on your computer
  2. Copy the “administrator” folder in the archive to your base “joomla” 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 instructions below
  3. Login to the Joomla Administrator console
  4. Using the main menu, navigate to Components → VirtueMart
  5. Using the VirtueMart menu, navigate to Store → Add Payment Method
  6. Enter the following details in the “Payment Method Form” tab:
    • Active? = <checked>
    • Payment Method Name = “PayFast”
    • Code = “PF”
    • Payment class name = “ps_payfast”
    • Payment method type = “HTML-Form based (e.g. PayPal)”
    • (Leave all other fields as they are)
  7. Click Save
  8. Click on the newly added “PayFast” method in the payment methods list
  9. Click on the Configuration tab
  10. Copy the contents of the “payment_extra_info.php” file into the “Payment Extra Info” field
  11. Click Save
  12. 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 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:

administrator/components/com_virtuemart/payfast_notify.php
administrator/components/com_virtuemart/classes/payfast.log
administrator/components/com_virtuemart/classes/payfast_common.inc
administrator/components/com_virtuemart/classes/payment/ps_payfast.cfg.php
administrator/components/com_virtuemart/classes/payment/ps_payfast.php
administrator/components/com_virtuemart/html/checkout.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 Joomla Administrator console
  2. Using the main menu, navigate to Components → VirtueMart
  3. Using the VirtueMart menu, navigate to Store → List Payment Methods
  4. Click on the “PayFast” payment method
  5. Click on the “Configuration” tab
  6. Change the configuration values as below:
    • Transaction Server = “LIVE”
    • Merchant ID = <Your ID as given on your Integration page>
    • Merchant Key = <Your Key as given on Integration page>
    • (Change the other fields as per your preferences)
  7. Click Save

Upgrading

VirtueMart 1.0

Version 1.00 -> 1.01

See “Standard Upgrade Procedure”

Version 1.01 -> 1.02

See “Standard Upgrade Procedure”

Version 1.02 -> 1.10

See “Standard Upgrade Procedure”

Standard Upgrade Procedure

  1. Unzip the module to a temporary location on your computer
  2. Copy the “administrator” folder in the archive to your base “joomla” folder
    • This should only overwrite existing PayFast files, and no other 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
  3. Using the main menu, navigate to Components → VirtueMart
  4. Using the VirtueMart menu, navigate to Store → List Payment Methods
  5. Click on the “PayFast” payment method
  6. Click on the “Configuration” tab
  7. Change the configuration values as below:
    • Transaction Server = “LIVE”
    • Merchant ID = <Your ID as given on your Integration page>
    • Merchant Key = <Your Key as given on Integration page>
    • (Change the other fields as per your preferences)
  8. Copy the contents of the “payment_extra_info.php” file into the “Payment Extra Info” field
  9. Click Save

VirtueMart 1.1

Version 1.00 -> 1.10

See “Standard Upgrade Procedure”

Version 1.10 -> 1.11

See “Standard Upgrade Procedure”

Version 1.11 -> 1.20

See “Standard Upgrade Procedure”

Standard Upgrade Procedure

  1. Unzip the module to a temporary location on your computer
  2. Copy the “administrator” folder in the archive to your base “joomla” folder
    • This should only overwrite existing PayFast files, and no other 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
  3. Using the main menu, navigate to Components → VirtueMart
  4. Using the VirtueMart menu, navigate to Store → List Payment Methods
  5. Click on the “PayFast” payment method
  6. Click on the “Configuration” tab
  7. Change the configuration values as below:
    • Transaction Server = “LIVE”
    • Merchant ID = <Your ID as given on your Integration page>
    • Merchant Key = <Your Key as given on Integration page>
    • (Change the other fields as per your preferences)
  8. Copy the contents of the “payment_extra_info.php” file into the “Payment Extra Info” field
  9. Click Save

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.

Modifying the "Pending" status setting doesn't work as expected

Modifying the order statuses within VirtueMart is not recommended and requires expert knowledge of how VirtueMart works.

Modifying the Pending status setting in the PayFast module is not going to change the status an order gets when it is first created. That is up to VirtueMart itself. That setting works differently to the way the Successful and Cancelled ones work. For the Pending one, you are basically telling that PayFast module what status is considered to be “Pending” in your VirtueMart installation, not what the module must set pending payments to, as that is up to VirtueMart when the order is first created.

The Successful and Cancelled options are however used by the module to update the order status appropriately based on feedback from PayFast.

If you want to change the VirtueMart statuses in line with your business processes, you will need to consult the VirtueMart site or the internet for help in this regard as to what to do within VirtueMart to achieve this and then update the PayFast module “pending” option in line with your changes to VirtueMart.

Where is my "base Joomla folder"?

This is the root of your Joomla 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 Joomla directory structure.

The base (or root) Joomla 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 Joomla folder”.

Directory structure of base Joomla folder

Can I display my prices in currencies other than ZAR?

Yes, you can display your prices in currencies other than ZAR, but PayFast can only process payments in ZAR and when the user checks out, whatever currency they have selected to display your product prices will be converted to ZAR.

To set this up, do as follows:

  1. Install the “VirtueMart Currency Selector” module
  2. Enable the module within the “Module Manager”
  3. Click on the module name with the “Module Manager”
  4. In the “Module Parameters” section, select which currencies you want to display in the “The currencies to display” list
  5. Click Save

For this to work properly though, you must ensure that your store is configured to only accept ZAR! This is done as follows:

  1. Using the VirtueMart menu, navigate to Store → Edit Store
  2. Under the “Currency Display Style” heading, ensure that the “Currency” dropdown is set to “South Africa Rand”
  3. In the same area, find the “List of accepted currencies” list and ensure that only “South African Rand” is selected in this list
  4. Click Save

LiveSupport
Live Support