Gravity Forms

Gravity Forms has one of the easiest interfaces to set up dynamic forms in WordPress. Both the site admin and the visitor that submitted the form can receive success notifications. Additional extensions such as integration with PayFast, makes it a really valuable tool, particularly when using the Pricing Fields.

Gravity Forms

Key Features

  • Drag and drop builder
  • Import and export data
  • Intelligent notifications
  • Pricing fields with PayFast payment

Integration

See PayFast integration

How does the PayFast integration work 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 check out.

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.

What are the installation requirements?

  • A working WordPress installation with the Gravity Forms Plugin installed

INSTALLATION AND TESTING

How do I install the PayFast module?

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

  1. Download the Gravity Forms payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. 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
  4. Log in to the WordPress Administrator console
  5. Go to ‘Plugins’ and activate the PayFast Gravity Forms plugin.
  6. Go to ‘Forms’ -> ‘Settings’ -> ‘PayFast’. Please note that once you have checked the box ‘I understand’, Gravity Forms, unfortunately, does not redirect you
  7. Go to ‘Forms’ -> ‘Settings’, under ‘General Settings’, select ‘South African Rands’ for your currency, and click save settings
  8. Go to ‘Forms’ -> ‘New Form’ and create a new form. PayFast Feeds are now accessed via the PayFast sub-menu within the Form Settings for the Form you would like to integrate PayFast with
  9. Go to ‘Forms’ and click ‘Edit’ for your new form and generate your form as required, including Pricing Fields, and Update
  10. Then, while still on your form,  go to ‘Settings’ -> ‘PayFast’ -> ‘Add New’ PayFast Feed. Complete the feed settings accordingly.
  11. To test, select ‘Test’ mode and leave the fields for merchant ID, Key and Passphrase empty. Click ‘Update Settings’ when you are ready.
  12. To test with the sandbox, use the following login credentials when redirected to the PayFast site (note: sandbox does not currently work for subscriptions):
    • Username: sbtu01@payfast.co.za
    • Password: clientpass
  13. 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

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 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

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 creating an invoice and completing the payment cycle through the PayFast sandbox, 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 Ukash payment 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.

Can I test recurring payments in test mode?

Unfortunately, you will not be able to test recurring payments in test mode.

See PayFast FAQs

UPGRADING

Standard Upgrade Procedure

  1. Download the Gravity Forms payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. Copy the “wp-content” folder in the archive to your base “wordpress” folder

FREQUENTLY ASKED QUESTIONS (FAQS)

What Gravity Forms license do I need to use the PayFast Plugin?

The PayFast plugin will work with any one of the Gravity Forms licenses.

What is the payment flow? What happens if a buyer cancels?

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

At this stage, the order has already been created in MarketPress with the status “Received”.

If the payment is CANCELLED during processing on PayFast:

  • The user will be returned to the “Transaction Results” page
  • The order status will be left as “Incomplete Sale”
  • Although there is an entry on Gravity Forms for the merchant’s records, the buyer would need to fill out the form again and submit it in order to make a payment

If the payment is SUCCESSFUL through PayFast:

  • The user will be returned to the “Confirmed” page
  • The order status will be updated to the status “Paid”

Do I need to set the ITN url on my account? What about the cancel url?

No. When using one of our payment modules, the ITN url is set automatically and you do not need to set it on your account manually. Please note that the return and notify URLs are set by the plugin. You can set the cancel URL to whatever you would like.

Where is my “base WordPress folder”?

This is the root of your WordPress installation. Where this is, depends on what system you are using and where you are hosting.

The easiest way to find this though would be to look for the WordPress directory structure.

The base (or root) WordPress folder will look similar to the image shown below.

Simply find the folder in your installation which looks similar to this structure and that will be your “base WordPress folder”.

Directory structure of base WordPress folder

USEFUL LINKS