Once you have followed the installation instructions below and your form is live on your website, a buyer will be able to complete the form and an entry will be added to Gravity Forms once they checkout.
When a successful payment is made, PayFast then sends back a payment notification (ITN) to Gravity Forms which will update the entry from processing to paid.
- A working WordPress installation with the Gravity Forms Plugin installed
Installation and testing
To install the PayFast payment module, follow the instructions below:
- Download the Gravity Forms payment module from our site.
- Unzip the module to a temporary location on your computer.
- Copy the “wp-content” folder in the archive to your base “wordpress” 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.
- Log into the WordPress Administrator console.
- Go to ‘Plugins’ and activate the PayFast Gravity Forms plugin.
- Go to Forms > Settings > PayFast. Select ‘PayFast Debug’ and save settings.
- Go to Forms > Settings > Settings, under ‘General Settings’, select ‘South African Rands’ for your currency, and click 'Save settings'.
- PayFast Feeds are accessed via the PayFast sub-menu within the Form Settings for the Form you would like to integrate PayFast with. To create a new form, go to Forms > New Form.
- Go to ‘Forms’ and click ‘Edit’ for your new form and generate your form as required, including Pricing Fields, and click 'Update'.
- Then, while still on your form, go to Settings > PayFast > Add New PayFast Feed. Complete the feed settings accordingly.
- To test, select ‘Test’ mode and leave the fields for Merchant ID, Key and Passphrase empty. Click ‘Update Settings’ when you are ready.
- To set up a subscription, select ‘Subscription’ under ‘Transaction Type’.
- Ensure that subscriptions are enabled on the Integration page (under Settings) on your PayFast account
Copying 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 is as follows:
wp-content/plugins/gravityformspayfast/flot/jquery.flot.min.js wp-content/plugins/gravityformspayfast/images/* wp-content/plugins/gravityformspayfast/js/currency.js wp-content/plugins/gravityformspayfast/class-gf-payfast.php wp-content/plugins/gravityformspayfast/payfast.php wp-content/plugins/gravityformspayfast/payfast_common.inc
Testing that it is working correctly
If you followed the installation instructions above, the module is in 'test' mode and you can test it by creating an invoice and completing the payment cycle through the PayFast Sandbox. log in 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 of the test user will give you exactly the same results as if you had used another payment method.