PayFast refunds in WooCommerce
There are two ways to refund a WooCommerce order that was paid through PayFast.
Option 1: refund in PayFast, record it in WooCommerce
Works with every plugin and every PayFast account.
- In your PayFast dashboard, find the transaction and issue the refund there.
- In WooCommerce, open the order, click Refund, enter the amount and items, and click Refund manually. This records the refund and restocks items without contacting PayFast again.
The risk is doing one step and forgetting the other, so your WooCommerce reports and your PayFast balance drift apart.
Option 2: refund from the WooCommerce order screen
The Refund ... via PayFast button on the WooCommerce order screen only appears if your PayFast plugin supports refunds through the PayFast API. For that to work:
- PayFast must have API access enabled on your merchant account. If it is not on, ask PayFast support.
- You must have a salt passphrase set in PayFast and in the plugin, because API requests are signed with it.
- The refund setting must be switched on in the plugin, if it has one.
If the button is missing, your plugin either does not support API refunds or the setting is off. If the button gives an error, the plugin log usually names the API's reply (authentication failed, refund amount too high, transaction not found).
Testing refunds
PayFast's sandbox does not process API refunds the way live does, so a refund test in sandbox mode can fail even when everything is set up correctly. Test refunds on live with a small real order instead (for example R5, then refund it).
Our plugin
Skillmerc Payment Gateway for PayFast is free on WordPress.org and does refunds from the WooCommerce order screen once you tick the Refunds setting (needs API access on your PayFast account and a passphrase). Independent, not made by PayFast.