PayFast Integration with Gravity Forms
Integrate PayFast with Gravity Forms to accept secure online payments directly through your WordPress forms. This integration is ideal for payments, registrations, donations, subscriptions, and service bookings.
How do I integrate PayFast with Gravity Forms?
Once configured, customers complete the form, are redirected to PayFast for payment, and the transaction status is automatically returned to Gravity Forms.
Installation requirements
Before you begin, ensure you have:
- A working WordPress website
- Gravity Forms plugin installed and activated
- PayFast merchant account
- PayFast Merchant ID and Merchant Key
- Administrator access to your WordPress dashboard
Installation and setup
Step 1 — Install the PayFast Add-On for Gravity Forms
- Log in to your WordPress Admin dashboard.
- Navigate to Forms → Add-Ons (or Plugins → Add New, depending on your setup).
- Install the PayFast add-on for Gravity Forms.
- Activate the plugin.
Step 2 — Configure PayFast account details
- Go to Forms → Settings → PayFast.
- Enter your PayFast credentials:
- Merchant ID
- Merchant Key
- Passphrase (if configured on your PayFast account)
- Save the settings.
Step 3 — Create or edit a payment form
- Navigate to Forms → New Form (or edit an existing form).
- Add the required fields (for example):
- Name
- Product or service details
- Pricing fields (required for payments)
- Click Update to save the form.
Step 4 — Create a PayFast feed
A feed connects the form to PayFast.
- Open the form editor.
- Navigate to Settings → PayFast → Add New.
- Configure the feed settings:
- Transaction type
- Payment amount (linked to pricing fields)
- Customer details mapping
- Success and cancellation behaviour
- Save the feed.
Recurring billing (subscriptions)
If your form includes subscription or recurring pricing fields, PayFast can process recurring payments.
Recurring billing requires compatible pricing fields and an eligible PayFast account configuration.
For advanced subscription setups, contact PayFast support.
Testing in sandbox mode
Before going live, always test your integration.
- Navigate to your form’s PayFast feed settings.
- Enable Test Mode.
- Use sandbox credentials if available, or leave live credentials configured as instructed by PayFast.
- Submit the form on your website to simulate a transaction.
After payment, verify that:
- The customer is redirected correctly
- Payment status updates in Gravity Forms
- Confirmation emails or notifications are triggered
Going live
When testing is complete:
- Return to the PayFast feed settings.
- Disable Test Mode.
- Confirm your live Merchant ID and Merchant Key are correct.
- Save changes.
Your form is now ready to accept live payments.
How payment confirmation works
After payment:
- The customer is redirected back to your website.
- PayFast sends an Instant Transaction Notification (ITN) to your server.
- Gravity Forms updates the entry status (for example, Processing → Paid).
This ensures reliable confirmation even if the customer closes the browser after payment.
Troubleshooting tips
If payments are not working as expected:
- Verify your Merchant ID and Key
- Confirm the PayFast feed is active
- Ensure pricing fields are configured correctly
- Check that ITN notifications are not blocked by your hosting provider
- Confirm Test Mode is disabled for live transactions
Need additional help?
For advanced configuration, subscription billing, or troubleshooting assistance, contact PayFast support or your web developer.
Updated about 2 months ago