How do I integrate PayFast with Gravity Forms?
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.
Installation requirements
An operational working WordPress installation with the Gravity Forms Plugin installed
Installation and testing
To install the PayFast payment module, do the following:
Unzip the module to a temporary location on your computer.
Copy the gravityformspayfast folder into the plugins folder inside the wp-content folder of your gravity forms base folder.
Log in to the WordPress Administrator console.
Navigate to Plugins and activate the PayFast Gravity Forms plugin.
Navigate to Forms > Settings > PayFast. Select PayFast Debug and click Update Settings.
Navigate 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, navigate to Forms > New Form.
Navigate 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, navigate to Settings > PayFast > Add New. Complete the feed settings accordingly.
Enter your Merchant ID and Key from your PayFast Dashboard
If you have a passphrase set on your account, enter it as well. Otherwise leave the passphrase field blank.
Recurring Billing
Testing that it is working correctly
To make test transactions in our sandbox mode, navigate to your form then click Settings > PayFast and then edit the PayFast Feed that you created. Select Test mode and leave the fields for Merchant ID, Key and Passphrase empty. You can either leave the Merchant ID, Merchant Key, and Passphrase inputs empty, or you can make use of a unique sandbox account, when testing in sandbox mode. Click Update Settings when you are ready.
If you have 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.