WooCommerce · Guide
How to Integrate PayFast with WooCommerce (Step by Step)

Short answer
Install the WooCommerce Payfast Gateway plugin, set your store currency to South African rand, and enter your Payfast merchant ID, merchant key and passphrase under WooCommerce Payments settings. Test with sandbox mode, then switch to live credentials and place one small real order.
Key takeaways
- Use the official WooCommerce Payfast Gateway plugin.
- Set the store currency to South African rand.
- The passphrase must match Payfast exactly.
- Test in sandbox before switching to live credentials.
- Pending orders usually mean blocked ITN notifications.
How do you integrate Payfast with WooCommerce?
Install the free Payfast Gateway plugin, set your store currency to South African rand, then paste your Payfast merchant ID, merchant key and passphrase into WooCommerce > Settings > Payments > Payfast and enable it.
Payfast is a South African payment gateway. It lets shoppers pay by card, instant EFT and other local methods on a Payfast-hosted page, then sends them back to your store.
The integration has four parts:
- A Payfast merchant account
- The WooCommerce Payfast Gateway plugin
- Your Payfast credentials entered in WooCommerce
- A test order in sandbox, then a real low-value order
If you are new to how gateways work, our explainer on what a payment gateway is covers the basics.
What do you need before you start?
You need a verified Payfast merchant account, a live WooCommerce store on https, and your store currency set to South African rand.
Checklist:
- Payfast account. Sign up on the Payfast website and complete verification so you can receive payouts.
- SSL certificate. Your store should load on https so checkout and notifications are secure.
- Public website. Payfast must reach your site to confirm payments, so a site on localhost or behind a password will not complete orders.
- ZAR currency. Payfast processes payments in rand. Set the store currency under WooCommerce > Settings > General.
- Admin access. You need permission to install plugins.
If your store sells in more than one currency, check the Payfast and plugin documentation for current support before launch. Our guide on how to set up multi-currency in WooCommerce explains the tradeoffs.
How do you install the Payfast plugin?
Go to Plugins > Add New, search for Payfast, and install and activate the WooCommerce Payfast Gateway plugin made by WooCommerce.
Steps:
- In wp-admin, go to Plugins > Add New Plugin
- Search for Payfast
- Find the WooCommerce Payfast Gateway plugin
- Click Install Now, then Activate
Several plugins mention Payfast in search results. Check the author and active installs so you pick the official one. The plugin's source code is also public in the WooCommerce Payfast gateway repository on GitHub.
Where do you find your Payfast credentials?
Log in to your Payfast dashboard and open the settings or integration area, where you will find your merchant ID and merchant key, and where you set a passphrase.
You need three values:
| Credential | Where it comes from | Notes |
|---|---|---|
| Merchant ID | Payfast dashboard | Identifies your account |
| Merchant key | Payfast dashboard | Pairs with the merchant ID |
| Passphrase | You create it in Payfast settings | Used to sign requests, must match exactly |
The passphrase is the part people forget. If you set one in Payfast, you must enter the exact same value in WooCommerce. If they differ, payment notifications fail signature checks and orders stay pending.
Payfast's developer documentation explains the merchant ID, key, passphrase and signature process in detail.
Keep these values private. Anyone with them could try to send fake requests to your account.
How do you set up Payfast in WooCommerce?
Go to WooCommerce > Settings > Payments, open Payfast, enter your credentials, set the title and description shoppers see, and save.
Steps:
- Go to WooCommerce > Settings > Payments
- Find Payfast and click Manage or Set up
- Tick Enable Payfast
- Set the title, such as Pay with Payfast
- Write a short description, such as Pay securely by card or instant EFT
- Enter your merchant ID and merchant key
- Enter your passphrase
- Leave sandbox mode on for now
- Turn on debug logging while you test
- Save changes
The WooCommerce Payfast documentation lists every setting and its purpose.
Field names can shift a little between plugin versions, but the core settings stay the same. Our overview of WooCommerce payment settings explains the general Payments screen, including how to reorder gateways.
How do you test Payfast in sandbox mode?
Turn on sandbox mode in the Payfast settings, use the sandbox merchant details Payfast provides, then place a test order and confirm it moves to Processing.
Sandbox mode sends shoppers to Payfast's test environment instead of the live one. No real money changes hands.
Test steps:
- Enable sandbox in the Payfast plugin settings
- Enter sandbox credentials from your Payfast sandbox account
- Open your store in a private window
- Add a product to the cart and check out with Payfast
- Complete the test payment on the Payfast page
- Return to the store and check the order under WooCommerce > Orders
A successful test shows the order as Processing for physical products or Completed for virtual downloads, with a Payfast note on the order.
For a full testing plan across gateways, see how to test WooCommerce payments.
How do you go live with Payfast?
Turn off sandbox mode, replace sandbox credentials with your live merchant ID, key and passphrase, save, and place one small real order to confirm everything works.
Go-live checklist:
- Untick sandbox mode
- Enter live credentials
- Confirm the passphrase matches your live Payfast settings
- Place a low-value real order
- Check the payment appears in your Payfast dashboard
- Confirm the order status updated in WooCommerce
- Refund the test order if needed
- Turn off debug logging once all is well
Debug logs can contain order details, so do not leave verbose logging on forever. You can read logs under WooCommerce > Status > Logs.
How does Payfast confirm payments?
Payfast sends an Instant Transaction Notification, called ITN, to your store after payment, and the plugin uses it to mark the order as paid.
This happens in the background, separate from the shopper returning to your site. Even if the shopper closes the browser, the ITN should still update the order.
For ITN to work:
- Your site must be publicly reachable
- Firewalls and security plugins must not block Payfast's requests
- Caching must not apply to the notification URL
- The passphrase and signature must match
- Your server must be able to make outbound https requests for validation
If orders stay pending after a successful payment, ITN is the first thing to check. Our guide on fixing orders stuck on pending payment covers this in depth.
What problems come up with Payfast and WooCommerce?
The common problems are a mismatched passphrase, the wrong currency, blocked notifications, and leaving sandbox on with live credentials or the reverse.
| Problem | Likely cause | Fix |
|---|---|---|
| Payfast missing at checkout | Gateway disabled or currency not ZAR | Enable it and set currency to rand |
| Signature mismatch error | Passphrase differs between Payfast and WooCommerce | Re-enter the exact same passphrase |
| Orders stay pending | ITN blocked by firewall, cache or security plugin | Allow Payfast requests, exclude from cache |
| Test payments in live mode fail | Sandbox credentials with sandbox off | Match mode and credentials |
| Customers see an error on Payfast page | Wrong merchant ID or key | Copy credentials again from dashboard |
Check WooCommerce > Status > Logs for the Payfast log. It usually names the failing step. If the problem is a general payment failure, see how to fix a WooCommerce payment failed error.
Does Payfast work with subscriptions and refunds?
Payfast supports recurring billing, and the plugin works with WooCommerce Subscriptions for repeat payments, but check current refund and subscription details in the plugin docs.
Recurring payments need extra setup in your Payfast account. Some payment methods do not support recurring billing, so shoppers may see fewer options on subscription products.
Refunds may be possible from inside WooCommerce for some payment methods, while others need processing in the Payfast dashboard. Confirm what applies to your account before you promise customers instant refunds.
Fees vary by payment method and can change. Check the pricing page on the Payfast website for current rates.
Should you use Payfast or another gateway?
Payfast is a strong choice for stores selling mainly to South African shoppers, while stores selling worldwide often add a second gateway such as Stripe or PayPal.
Points to weigh:
- Payfast supports local methods South African shoppers know, such as instant EFT
- It works in rand, so international buyers may prefer another option
- A second gateway gives shoppers a backup if one fails
You can run Payfast alongside other gateways. Our guide on how to add a payment method in WooCommerce shows how to add and order more than one.
Frequently asked questions
Is the Payfast plugin for WooCommerce free?
Yes. The WooCommerce Payfast Gateway plugin is free to install from the WordPress plugin directory. Payfast charges transaction fees on payments, which vary by payment method. Check the Payfast pricing page for current rates.
Why is Payfast not showing at checkout?
The gateway may be disabled, or the store currency is not South African rand. Enable Payfast in WooCommerce payment settings and set the currency under WooCommerce general settings, then reload checkout.
What is the Payfast passphrase used for?
The passphrase signs data sent between your store and Payfast so both sides can verify it. It must match exactly in your Payfast account and the plugin settings, or notifications fail and orders stay pending.
Can I test Payfast on a local site?
You can reach the payment page, but Payfast cannot send payment notifications to localhost. Orders will not update. Test on a public staging site with https instead.
Why do Payfast orders stay pending after payment?
Payfast's payment notification did not reach your store or failed validation. Check firewall and security plugin rules, exclude the notification URL from caching, confirm the passphrase, and read the Payfast log in WooCommerce.
Sources
- Payfast Payment Gateway WooCommerce
- WooCommerce Payfast Gateway WordPress.org Plugins
- woocommerce-gateway-payfast GitHub
- Payfast developer documentation Payfast
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


