CubeCart

CubeCart is a complete commerce shopping cart software solution. With CubeCart you can quickly set up a powerful online store to sell digital or tangible products to new and existing customers globally.

CubeCart

Key Features

  • Unlimited products
  • Unlimited categories
  • HTML templates
  • Sales reports

Integration

You’ll need a working installation of CubeCart┬ábefore you can integrate with PayFast. Kindly see their website for more information.

See PayFast integration steps for CubeCart v3

How do I use PayFast with CubeCart?

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

What are the installation requirements?
  • A working CubeCart 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?
Cube Cart v3
  1. Download the appropriate payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. Copy and paste the files into your CubeCart 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 CubeCart admin console
  5. Navigate to Modules ? Gateways
  6. Click on PayFast logo (or on ‘Configure’ next to PayFast logo)
  7. Change values in form:
    • Set ‘Status’ to Enabled
  8. Click ‘Edit Config’ button to save configuration
  9. Open the file ‘includes/content/confirmed.inc.php’ with a text editor
  10. Change the statement on line 49 as below:
    • Old:
      if(ereg("Authorize|WorldPay|Protx|SECPay|BluePay|mals-e|Nochex_APC|PayOffline",$pg)){
    • New:
      if(ereg("Authorize|WorldPay|Protx|SECPay|BluePay|mals-e|Nochex_APC|PayOffline|PayFast",$pg)){
  11. Save and close the file

After completing these instructions, the module is installed and ready to be tested in the sandbox environment (The pre-populated Merchant ID and Merchant Key values are the generic sandbox test credentials).

I”m ready to go live! What do I do?
Cube Cart v3

In order to make the module ‘LIVE’, follow the instructions below:

  1. Login to the CubeCart admin console
  2. Navigate to Modules ? Gateways
  3. Click on PayFast logo (or on ‘Configure’ next to PayFast logo)
  4. Change values in form:
    • Set ‘Merchant ID’ to your Merchant ID
    • Set ‘Merchant Key’ to your Merchant Key
    • Set ‘Server’ to Live
  5. Click ‘Edit Config’ button to save configuration

See PayFast integration steps for CubeCart v4

How do I use PayFast with CubeCart?

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

What are the installation requirements?
  • A working CubeCart installation
  • PHP cURL extension
    • Ask your host if you are not sure if this is available
Cube Cart v4

To install the PayFast Website Payments payment module, please follow the instructions below:

  1. Download the appropriate payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. Copy and paste the files into your CubeCart installation as they were extracted
  4. Login to the CubeCart admin console
  5. Navigate to Modules ? Payment Methods
  6. Click on PayFast logo (or on ‘Configure’ next to PayFast logo)
  7. Change values in form:
    • Set ‘Status’ to Enabled
  8. Click ‘Edit Config’ button to save configuration

After completing these instructions, the module is installed and ready to be tested in the sandbox environment (The pre-populated Merchant ID and Merchant Key values are the generic sandbox test credentials).

I”m ready to go live! What do I do?
Cube Cart v4

In order to make the module ‘LIVE’, follow the instructions below:

Login to the CubeCart admin console

  1. Navigate to Modules ? Payment Methods
  2. Click on PayFast logo (or on ‘Configure’ next to PayFast logo)
  3. Change values in form:
    • Set ‘Merchant ID’ to your Merchant ID
    • Set ‘Merchant Key’ to your Merchant Key
    • Set ‘Server’ to Live
  4. Click ‘Edit Config’ button to save configuration

The module will then be live for transaction processing.

See PayFast integration steps for CubeCart v5 and v6

How do I use PayFast with CubeCart?

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

What are the installation requirements?
  • A working CubeCart installation
  • PHP cURL extension
    • Ask your host if you are not sure if this is available
Cube Cart v5 and v6

To install the PayFast Website Payments payment module, please follow the instructions below.

  1. Download the v5 payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. Copy and paste the files into your CubeCart installation as they were extracted
  4. Login to the CubeCart admin console
  5. Navigate to Plugins > Manage Plugins
  6. Click on ‘PayFast’ (or on the ‘Edit’ logo next to PayFast)
  7. Change values in form:
    Check the ‘Status’ checkbox
    Click ‘Save’ button to save configuration.

After completing these instructions, the module is installed and ready to be tested in the sandbox environment (The pre-populated Merchant ID and Merchant Key values are the generic sandbox test credentials).

I”m ready to go live! What do I do?
Cube Cart v5

In order to make the module ‘LIVE’, follow the instructions below:

Login to the CubeCart admin console

  1. Navigate to Modules ? Payment Methods
  2. Click on PayFast logo (or on ‘Configure’ next to PayFast logo)
  3. Change values in form:
    • Set ‘Merchant ID’ to your Merchant ID
    • Set ‘Merchant Key’ to your Merchant Key
    • Set ‘Server’ to Live
  4. Click ‘Edit Config’ button to save configuration

The module will then be live for transaction processing.

Cube Cart v6

In order to make the module ‘LIVE’, follow the instructions below:

Login to the CubeCart admin console

  1. Navigate to Plugins > Mangae Plugins
  2. Click on ‘PayFast’ (or on the ‘Edit’ logo next to PayFast)
  3. Change values in form:
    1. Set ‘Merchant ID’ to your Merchant ID
    2. Set ‘Merchant Key’ to your Merchant Key
    3. Set ‘Server’ to Live
  4. Click ‘Save’ button to save configuration

The module will then be live for transaction processing.

See Upgrading and FAQs

Upgrading

Cube Cart v3

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. Copy and paste the files into your CubeCart installation as they were extracted
  2. Login to the CubeCart admin console
  3. Navigate to Modules ? Gateways
  4. Click on PayFast logo (or on ‘Configure’ next to PayFast logo)
  5. Change values in form:
    • Set ‘Merchant ID’ to your Merchant ID
    • Set ‘Merchant Key’ to your Merchant Key
    • Set ‘Server’ to Live
    • Set ‘Status’ to Enabled
  6. Click ‘Edit Config’ button to save configuration
Cube Cart v4

Version 1.00 -> 1.01

See ‘Standard Upgrade Procedure’

Version 1.01 -> 1.1

See ‘Standard Upgrade Procedure’

Standard Upgrade Procedure

  1. Copy and paste the files into your CubeCart installation as they were extracted
  2. Login to the CubeCart admin console
  3. Navigate to Modules ? Gateways
  4. Click on PayFast logo (or on ‘Configure’ next to PayFast logo)
  5. Change values in form:
    • Set ‘Merchant ID’ to your Merchant ID
    • Set ‘Merchant Key’ to your Merchant Key
    • Set ‘Server’ to Live
    • Set ‘Status’ to Enabled
  6. Click ‘Edit Config’ button to save configuration

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 manually transfer the modules files?
Cube Cart v3

The files for the module as contained in the zip file you downloaded are as follows:

/admin/modules/gateway/PayFast/index.php
/admin/modules/gateway/PayFast/logo.gif
/modules/gateway/PayFast/notify.php
/modules/gateway/PayFast/transfer.inc
Cube Cart v4

The files for the module as contained in the zip file you downloaded are as follows:

/modules/gateway/PayFast/call.inc.php
/modules/gateway/PayFast/index.php
/modules/gateway/PayFast/payfast_common.inc
/modules/gateway/PayFast/process.inc.php
/modules/gateway/PayFast/transfer.inc.php
/modules/gateway/PayFast/admin/index.inc.php
/modules/gateway/PayFast/admin/logo.gif
Cube Cart v5

The files for the module as contained in the zip file you downloaded are as follows:

/modules/gateway/PayFast/config.xml
/modules/gateway/PayFast/gateway.class.php
/modules/gateway/PayFast/payfast.log
/modules/gateway/PayFast/payfast_common.inc
/modules/gateway/PayFast/admin/index.inc.php
/modules/gateway/PayFast/language/module.definitions.xml
/modules/gateway/PayFast/skin/admin/index.tpl

In order to install the module in your CubeCart installation, you need to ensure that these files are transferred to your CubeCart installation exactly as they are in the zip file.

This will not overwrite anything which exists already (besides an already existing PayFast module).

To upload these files manually, do the following:

  1. Create the directory ‘PayFast’ at ‘/admin/modules/gateway/’ and transfer the ‘index.php’ and ‘logo.gif’ files to it.
  2. Create the directory ‘PayFast’ at ‘/modules/gateway/’ and transfer the ‘notify.php’ and ‘transfer.inc’ files to it

Then follow the rest of the installation instructions as given at elsewhere on this page.

Where is my “base Cube Cart folder”?

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

The base (or root) Cube 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 Cube Cart folder’.

Cube Cart 3 Cube Cart 4
Directory structure of base Cube Cart 3 folder Directory structure of base Cube Cart 4 folder
The order amount isn”t converted from $ to ZAR when redirect to PayFast!

Unfortunately, the PayFast CubeCart modules do not currently handle currency conversions.

Please ensure that you operate your store in ZAR to ensure correct operation.

What is the payment flow?
Cube Cart v3

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, an order is created in CubeCart with the status ‘Pending’. This is to ensure that you have a reference for payments in CubeCart in case anything goes wrong.

If the order is cancelled during processing on PayFast:

  • The order status will stay as ‘Pending’ on CubeCart
  • The user will be returned to the Complete page of checkout with an appropriate message displayed

If the order is successful during processing on PayFast:

  • The order status will be updated to ‘Processing’ on CubeCart
  • The user will be returned to the Complete page of checkout with an appropriate message displayed
Cube Cart v4

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, an order is created in CubeCart with the status ‘Pending (New Order)’. This is to ensure that you have a reference for payments in CubeCart in case anything goes wrong.

If the order is cancelled during processing on PayFast:

  • The order status will stay as ‘Pending (New Order)’ on CubeCart
  • The user will be returned to the Complete page of checkout with an appropriate message displayed

If the order is successful during processing on PayFast:

  • The order status will be updated to ‘Processing (See order notes)’ on CubeCart
  • The user will be returned to the Complete page of checkout with an appropriate message displayed
Why am I getting the error “Error: No payment gateway variable is set!”?

This is a Cube Cart 3 error which occurs if you haven’t followed the installation instructions in their entirety or if you upgraded Cube Cart to a more recent version.

Please complete the necessary installation steps (detailed elsewhere on this page) which discuss modifying the file ‘includes/content/confirmed.inc.php’.

Useful links