How do I integrate PayFast with Gravity Forms?

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: 

  1. Download the Gravity Forms payment module from PayFast.
  2. Unzip the module to a temporary location on your computer.
  3. Copy the gravityformspayfast folder into the plugins folder inside the wp-content folder of your gravity forms base folder.
  4. Log in to the WordPress Administrator console.
  5. Navigate to Plugins and activate the PayFast Gravity Forms plugin.
  6. Navigate to Forms > Settings > PayFast. Select PayFast Debug and click Update Settings.
  7. Navigate to Forms > Settings > Settings, under General Settings, select South African Rands for your currency, and click Save Settings.
  8. 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.
  9. Navigate to Forms and click Edit for your new form and generate your form as required, including Pricing Fields, and click Update.
  10. 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

To set up subscriptions for Gravity Forms, please follow our recurring billing instructions.

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.