First check, firewall IP block. No, hosts don’t block.
Second check, settings issue. Isn’t Payfast supposed to do it’s own ITN?
Third check, logging. Lots of it, if you can find it:
WooCommerce / Settings / Payments / Payfast / Manage
Wow! You can:
- Turn on the Sandbox
- Send Debug Emails. Uhm. Just remember to read them.
- Enable transaction logging for gateway. This one seems most interesting, but where the fuck is the logging? Somebody forgot to tell us?
Let the hunt begin. Thank God for AI.
wp-content/uploads/wc-logs/
Last error:
[28] => 197.97.145.154
)
CONTEXT: {“_legacy”:true}
2025-07-27T11:28:46+00:00 NOTICE Error occurred: Bad source IP address CONTEXT: {“_legacy”:true}
2025-07-27T11:28:46+00:00 NOTICE
———-
End ITN call
———- CONTEXT: {“_legacy”:true}
Fourth, simulation. Create a R5 product.
Test doesn’t work:
- No shipping method has been selected. Please double check your address, or contact us if you need any help.
Collegue engineer says add a new shipping address and another you have to check.
1) Viewing orders with status ‘Canceled’ you can see this info about the order under ‘Order Notes’:” Unpaid order cancelled – time limit reached. Order status changed from Pending payment to Cancelled. There is a setting in WooCommerce > Settings > Products > Inventory where the “Hold stock (minutes)” can be removed the value of ’60’ to disable it. The description states: Hold stock (for unpaid orders) for x minutes. When this limit is reached, the pending order will be cancelled. Leave blank to disable. – This probably will not solve the issue but just wanted to point out why the orders eventually become ‘Cancelled’.
2) There is a snippet code I want us to try, but it must be added to the Theme’s functions.php file. You can see the snippet at the bottom of the documentation’s Troubleshooting section: https://woocommerce.com/document/payfast-payment-gateway/
The error can be caused when a notification is being received from an unexpected IP address. Payfast may occasionally add or change the IP addresses that returns the ITN or payment notifications. If this issue persists, the following filter can be used to disable the check.
Note: snippet is offered as is. Our Happiness Engineers are not able to help with implementation or testing code snippets. If you choose to use it, please add it to a child theme’s functions.php file, or via a code snippet plugin to ensure it persists after updates.
add_filter( 'woocommerce_gateway_payfast_is_valid_ip', '__return_true' );
Please note a site needs to use a Child Theme when modifying the functions.php file, because any customisations will be lost if you update the theme. In the short run – just for testing – I have added the Snippet code to the main theme > Appearance > Theme File Editor > functions.php (at the very bottom). In the longer run I always recommend using a Child Theme.
3) I have added a new rule in the ‘Shipping settings’ for ‘Live testing’:
- Price is from R0-R19 = R0.00 shipping