Plugin - PayFast (Create custom order forms)

RSForm!Pro PayFast Payment Plugin
 

The RSForm!Pro PayFast Payment Integration Plugin allows you to add a new payment method to the existing Payment Package of RSForm!Pro.

 
Documentation Please make sure you install the Payment Package plugin first. Download the plugin
 
Downloading and Installing the plugin
 
Download

You can download the plugin by logging with your purchase user, then head to Downloads > My Downloads > RSForm!Pro - view all plugins and modules > RSForm!Pro Files > Plugins > "PayFast 3.1.0 Payment Plugin".

Install

In the backend of your Joomla! installation go to the Extensions > Install/Uninstall page, and install the plugin. Next thing is to publish the plugin, to do this go to Extensions > Plug-in Manager, search for the "System - RSForm! Pro PayFast Plugin" plugin and publish it.

 

Configuring the plugin

Configuring the PayFast payment gateway can be done from Components >> RSForm!Pro >> Configuration >> PayFast tab:

  • Merchant ID: Your Merchant ID can be found by logging into your PayFast account and clicking on the Settings page. Listed under "Merchant Identifiers".
  • Merchant Key: Your Merchant Key can be found by logging into your PayFast account and clicking on the Settings page. Listed under "Merchant Identifiers".
  • Passphrase: your PayFast security passphrase.
  • Sandbox Mode: No / Yes - Enable or disable Test Mode
  • Tax Type: Percent (%) / Fixed Rate
  • Tax Value: Amount of tax. Total amount of the transaction must include this amount.

Important: when testing PayFast, besides enabling the Sandbox Mode, ensure that you're using actual sandbox credentials as provided in the PayFast testing documentation.

 

How to use the PayFast plugin

After configuring the PayFast parameters from Components > RSForm!Pro > Configuration > PayFast tab, there are some additional steps that needs to be taken in order the payment process to work properly:


Making sure the form is sent to the payment processor

The payment details will only be sent to the PayFast payment processor if the user selects PayFast from the "Choose Payment" field before submitting the form.

The "Choose Payment" field is used in order to allow the users to choose their payment method. It displays the payment methods added to the form in either a Dropdown or Radio Group. It can be shown on the form (allowing the user to select his preferred payment method) or not (forcing the user to pay using the default payment method).

If you are using a single payment method and you need to hide the Choose payment field, this can be achieved by editing the field and setting to "No" the "Show in front-end?" option within the "Attributes" tab.

In order the PayFast payment method to be available within the Choose payment field, the PayFast payment field needs to be added in form.

 

Adding costs

In order to receive funds using RSForm!Pro and PayFast payment plugin, your form needs to include a cost. In order to add costs to your form you can use any of the following fields:

  • Single Product - Adds a single product to the form. For this type of field you can set up a caption, description and a price.
  • Multiple Products - Adds the ability to display multiple products to be purchased either in a Dropdown or a Checkbox. Its items need to be specified in the following manner: price | label (ex: 15 | T-shirt)
  • Quantity - Allows the user to choose the amount of products (simple or multiple).
  • Donation - Allows the user to type in the amount to be paid inside a standard Textbox.
  • Total - This field is used alongside the Donation, Single and Multiple Products fields. It calculates the total price to be paid.

A very important thing to note here is that all transactions made using this integration will use the South African Rand currency, or for short ZAR. You can read more about this topic in the PayFast official documentation.

Modifying PayFast vars through Scripts called after form has been processed

This process is similar to the already existing example regarding the PayPal parameters control. First you will need to require a helper file and then get a new instance of the PayFast object, this is done with:

require_once JPATH_ADMINISTRATOR . '/components/com_rsform/helpers/PayFast/PayFast.php';
$PayFast = RSFPPayFast::getInstance();

After this is done you will be able to override the parameters sent to PayFast using the following syntax:

$PayFast->args['item_name'] = 'my custom description goes here';

The above example will change the description. For a more detailed list of parameters available in the API you can check the official PayFast variables.

27 May 2024
Version 3.1.2
  • Updated - Payments are now sorted in the 'Choose Payment' field according to the same order in the form.
04 Mar 2024
Version 3.1.1
  • Added - Joomla! 5 native compatibility - no longer needs the 'Behaviour - Backward Compatibility' plugin.
12 Jul 2022
Version 3.1.0
  • Updated - Payment fields will now be correctly placed in the 'Payment' group.
09 Jun 2021
Version 3.0.0
  • Updated - Joomla! 4.0 and RSForm! Pro 3.0 compatibility.
25 Feb 2021
Version 1.0.7
  • Updated - Tax can now be shown when selecting this payment method.
20 Oct 2020
Version 1.0.6
  • Fixed - The status was not changed to 'Accepted' if the amount paid was higher than the original.
13 Apr 2020
Version 1.0.5
  • Added - Passphrase support.
  • Added - Logging of ITN failures in /logs/rsform_payfast_log.php
  • Updated - Code improvements.
20 Mar 2019
Version 1.0.4
  • Added - {_TRANSACTION_ID:value} support.
  • Fixed - {grandtotal} and {tax} placeholders are now formatted according to settings.
07 Sep 2017
Version 1.0.3
  • Fixed - Deferred emails were not being sent when payment was completed.
06 Sep 2017
Version 1.0.2
  • Fixed - The Thank You Message was not shown after payment.
12 May 2017
Version 1.0.1
  • Updated - Arguments can be overridden through RSFPPayFast::getInstance().
  • Fixed - Tax was not taken into account.
02 Dec 2016
Initial Release

5 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that

You Should Also Read

Plugin - Payment Package (Wire Transfer, PayPal) HOT

Plugin - Stripe (Create custom order forms) HOT

Plugin - eWAY (Create custom order forms) HOT

Plugin - iDeal (Create custom order forms) HOT

Plugin - Authorize.Net (Create custom order forms) HOT