1. Documentation
  2. Plugins
  3. WooCommerce
  4. Extensions

PayFast Payment Gateway

Our PayFast Payment Gateway extension for WooCommerce allows you to process payments via the South African payment processor, PayFast. Payment from any country may be accepted, but it is required to use ZAR as the store currency.

Installation ↑ Back to top

  1. Download the .zip file from your WooCommerce account.
  2. Go to: WordPress Admin > Plugins > Add New and Upload Plugin with the file you downloaded with Choose File.
  3. Install Now and Activate the extension.

More information at: Install and Activate Plugins/Extensions.

Requirements ↑ Back to top

  • A PayFast account to obtain a Merchant ID and Merchant Key. Note that Merchant IDs for developers and live sites are different, so you may need to update those in your live site.
  • Instant Transaction Notification (ITN) should be enabled. Replace the following with your domain for the notify URL. https://domain.com/?wc-api=WC_Gateway_PayFast

Sign up for PayFast ↑ Back to top

To register for a PayFast account.

  1. Go to: PayFast
  2. Register
  3. Verify your account.
  4. Go to: PayFast > Settings > Integration.
  5. Copy your Merchant ID and Merchant Key to use during setup of your WooCommerce store. Or leave this window open after signup. payfast-integration
  6. Add and copy a passphrase
  7. If you’re using Subscriptions and/or Pre-orders,
    • Verify that Ad hoc Payments are enabled under the Recurring Billing section. 

Setup and Configuration ↑ Back to top

To connect your store with PayFast:

  1. Go toWooCommerce > Settings > Payments > PayFast.
    Note: ‘Payments’ formerly called ‘Checkout’ prior to WooCommerce 3.4.
  2. Use the toggle under Enabled to select PayFast.
  3. Select Set Up. You are taken to the PayFast settings.
  4. Enable/Disable – Enable to use. Disable to turn off.
  5. Enter a Title and Description shown to customers at checkout (optional).
  6. Tick the Sandbox box if you are developing your website and not ready to accept payments and/or wish to test.
  7. Enter your Merchant ID, Merchant Key and Passphrase. Obtained from your PayFast account.
  8. Opting to Send Debug Emails, entering an address to receive emails for each transaction, and Logging – All are optional; typically used for troubleshooting.
  9. Save changes.

The PayFast extension uses the Merchant ID and Merchant Key fields to send cart information to your PayFast account.

Compatibility with other extensions ↑ Back to top

PayFast works well with several extensions. One thing to bear in mind is the initial charge may not be less than R5.00.

WooCommerce Subscriptions ↑ Back to top

As of version 1.4+, PayFast works with WooCommerce Subscriptions (separate purchase). Configure a simple or variable subscription product as described in the extension’s documentation.

Using PayFast with Subscriptions:

  • Basic features available: Subscription suspension and subscription cancellation
  • Advanced features available: Recurring total modification, payment date modification

While one user can own multiple subscriptions at the same time, PayFast is unable to process the purchase of multiple subscriptions in the same transaction. Two subscriptions cannot be added to the cart at the same time.

Cancellation works from both the WooCommerce store and the PayFast side. If you cancel at the store, the token is cancelled at PayFast. If you cancel at PayFast, the order is cancelled locally.

WooCommerce Pre-Orders ↑ Back to top

As of version 1.4+, PayFast works with WooCommerce Pre-Orders. Configure the products as described in the extension’s documentation.

Pre-Orders will not work if there is no initial fee charged. To address this, there are two options:

  • If you want to charge Upon Release, you need to set a Pre-Order Fee.payfast-preorders2
  • If you charge the full amount Upfront, setting a Pre-Order Fee is optional. payfast-preorders1

Test PayFast ↑ Back to top

It’s possible to test the PayFast payment gateway before going live.

To do this:

  1. Go to: WooCommerce > Settings > Payments > PayFast.
    Note: ‘Payments’ formerly called ‘Checkout’ prior to WooCommerce 3.4.
  2. Tick the PayFast Sandbox checkbox to put gateway in test mode. This replaces your Merchant ID and Merchant Key with an ID and Key for the Merchant Sandbox testing area.

3. Save changes.

When ready to go live, be sure to untick the PayFast Sandbox checkbox and Save changes again.

Note: Your Merchant ID and Merchant Key must be entered correctly and in the appropriate fields, even when using Sandbox mode. Otherwise, there will be an error in checkout. Also note that Merchant ID’s for developer and live sites are different, so you may need to update those in your live site after testing.

Questions and Feedback ↑ Back to top

Have a question before you buy? Please fill out this pre-sales form.

Already purchased and need some assistance? Get in touch with a Happiness Engineer via the Help Desk.


The most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment