OpenCart

OpenCart is a turn-key ready “out of the box” shopping cart solution

OpenCart

Key Features

  • Unlimited products and categories
  • Open-source
  • Reviews and ratings
  • Automatic image resize

Integration

See PayFast integration

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

  1. Download the correct version for your installation: v1.0* or v2.0 / v2.1 / v2.2 or v2.3 or v3.0*
  2. Unzip the module to a temporary location on your computer
  3. Copy the “admin” and “catalog” folders in the archive to your base “OpenCart” 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
  4. Login to the admin section of your OpenCart installation
  5. Navigate to the Extensions -> Payments page
  6. Scroll down to the PayFast.co.za payment method and click the “Install” button to install the module
  7. Once the module is installed, click on “Edit” button.
  8. The PayFast options will then be shown, select the payment status for “completed”, “failed” and “pending” payments, select the sandbox mode, enable the payment module and click “Save”.
  9. The module is now ready to be tested with the Sandbox.
  10. When you are ready to go live input your PayFast merchant ID, Key and passphrase (if it is set on your account), and set sandbox to ‘no’
  11. Click save

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, per version, is as follows:

OpenCart 3.0.*
admin/controller/extension/payment/payfast.php 
admin/language/en-gb/extension/payment/payfast.php 
admin/view/image/payment/payfast.png 
admin/view/image/payment/payfastlogo.gif 
admin/view/template/extension/payment/payfast.twig 
catalog/controller/extension/payment/payfast.php
catalog/controller/extension/payment/payfast_common.inc
catalog/language/en-gb/extension/payment/payfast.php 
catalog/model/extension/payment/payfast.php 
catalog/view/theme/default/image/payfast.png 
catalog/view/theme/default/image/payfastlogo.gif 
catalog/view/theme/default/template/extension/payment/payfast.twig

OpenCart 2.3.*
admin/controller/extension/payment/payfast.php 
admin/language/en-gb/extension/payment/payfast.php 
admin/view/image/payment/payfast.png 
admin/view/image/payment/payfastlogo.gif 
admin/view/template/extension/payment/payfast.tpl 
catalog/controller/extension/payment/payfast.php 
catalog/controller/payment/payfast_common.inc 
catalog/language/en-gb/extension/payment/payfast.php 
catalog/model/extension/payment/payfast.php 
catalog/view/theme/default/image/payfast.png 
catalog/view/theme/default/image/payfastlogo.gif 
catalog/view/theme/default/template/extension/payment/payfast.tpl

OpenCart 2.0-2.2
admin/controller/payment/payfast.php 
admin/language/english/payment/payfast.php 
admin/view/image/payment/payfast.png 
admin/view/image/payment/payfastlogo.gif 
admin/view/template/payment/payfast.tpl 
catalog/controller/payment/payfast.php 
catalog/controller/payment/payfast_common.inc 
catalog/language/english/payment/payfast.php 
catalog/model/payment/payfast.php 
catalog/view/theme/default/image/payfast.png 
catalog/view/theme/default/image/payfastlogo.gif 
catalog/view/theme/default/template/extension/payment/payfast.tpl

How can I test that it is working correctly?

If you followed the installation instructions above, the module is in “test” mode and you can test it by purchasing from your site as a buyer normally would. You will be redirected to PayFast for payment and can login with the user account detailed above and make payment using the balance in their wallet.

You will not be able to directly “test” a credit card, Instant EFT or any other payment method in the sandbox, but you don’t really need to. The inputs to and outputs from PayFast are exactly the same, no matter which payment method is used, so using the wallet will give you exactly the same results as if you had used another payment method.

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 admin section of your OpenCart system
  2. Navigate to the Extensions > Payments page
  3. Under PayFast.co.za, click on the “Edit” link
  4. In the PayFast Settings block, use the following settings:
    • Set Sandbox Mode = “No”
    • Merchant ID = <Login to PayFast -> Integration Page>
    • Merchant Key = <Login to PayFast -> Integration Page>
  5. Click Save

See Recurring Billing

RECURRING BILLING (only for version 2.3 and above)

To set up recurring billing, follow the instructions below:

  1. The instructions for integration above must be completed first, before setting up recurring billing.
  2. Log in to your PayFast account and navigate to Settings->Integration
  3. Click on ‘Enable’ or ‘Edit’ next to Recurring Billing and enable subscriptions (Once setup, subscriptions will be found under Transactions->Subscriptions on your PayFast account). You will be required to add a passphrase if you have not already done so.
  4. On OpenCart, ensure that you paste an exact copy of the passphrase in your configuration page.
  5. For a recurring billing product, the initial payment amount will be that of the product price (set up under Catalog->Products) and shipping, the recurring amount will be the price set under ‘Recurring Profile’.
  6. It is NOT possible to use the recurring trial period with OpenCart and PayFast for recurring products.
  7. OpenCart uses slightly different language to PayFast when it comes to recurring, due to this ‘Cycle’ in Recurring Profile MUST be set to 1. Duration is the number of payments (what PayFast refers to as cycles).
  8. It is only possible to use the ‘Month’ and ‘Year’ frequency with PayFast and Opencart.
  9. In order to cancel a subscription, you can log into your PayFast account and cancel the subscription.

How to test recurring billing:

  1. In the admin section, navigate to the Extensions -> Payments page.
  2. Scroll down to the PayFast.co.za payment method and click the “Edit” button.
  3. Select the sandbox mode and click “Save”.
  4. Complete a checkout of your recurring product and  click “Complete payment” when directed to the PayFast sandbox.

See Upgrading and FAQs

UPGRADING

Standard Upgrade Procedure

  1. Download the correct module you require for the upgrade: v2.3 or v3.0*
  2. Unzip the module to a temporary location on your computer
  3. To upgrade to version 2: Copy the “modules” folder in the archive to your base “OpenCart” folder
  4. To upgrade to version 3: Copy the “admin” and “catalog” folders to your base “OpenCart” folder. This should NOT overwrite any existing files or folders and merely supplement them with the PayFast files.

FREQUENTLY ASKED QUESTIONS (FAQS)

How do I add South African Rands

In the admin backend, go to System->Localisation->Currencies, click the “Add New” button and complete the form, enable the currency status and click “Save”.

How do I change the Default Currency?

In the admin backend, go to System->Settings click “Edit” go to “Local”, change currency from USD to ZAR, click “Save”; The list of currencies is generated for the currencies in the localisation settings.

PayFast isn’t listed in the Checkout

  1. Ensure that you are using the latest version of our plugin for the correlating version of OpenCart.
  2. Ensure that you have added a South African geo-zone (at System>Localisation->Geo Zones).
  3. Edit the tax options to include the geo-zone (at System->Localisation->Taxes->Tax Rates). Click on “Add New”, and create South African VAT, currently 15%. Be sure to set the Geo Zone setting to the one you created in the previous step.
  4. For currencies, set ZAR to default and remove other currencies.
  5. Ensure that your buyer’s address falls within the South African geo-zone.

What is the Payment Flow?

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

At this stage, the order has NOT been created in OpenCart, but the shopping cart details will be used.

If the payment is CANCELLED during processing on PayFast:

  • The user will be returned to the “Shopping Cart” page to either correct their shopping cart or to choose another payment gateway.

If the payment is SUCCESSFUL through PayFast:

  • The user will be returned to the “Order Confirmation” page
  • The order will be created and will have a status of “Confirmed”

USEFUL LINKS