• Resolved tokes123

    (@tokes123)


    Despite payfast confirming successful payments, clients payment status on woocommerce stays “stuck” on pending.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @tokes123.

    As a first step, please enable the logging for PayFast within the Payfast settings. You can do so from “WooCommerce > Settings > Payments > Payfast” page.

    Once done, please try to make a test order — it will now record some data to the debug log.

    After that, please head over to “WooCommerce > Status > Logs”, select the Payfast logs from the dropdown at the top right, and click “View”. Then copy the log into your response here so we can see if there are any errors that might help us in troubleshooting the issue.

    If you see anything in the logs that looks like this:

    Error occurred: Bad source IP address

    .. then that is because WooCommerce checks if the Payfast payment notification came from one of the trusted IP addresses, but your host may change that IP address for redirect purposes.

    You can get around this with the following one-liner code:

    add_filter( 'woocommerce_gateway_payfast_is_valid_ip', '__return_true' );

    Please make sure you add this line of code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update.

    Please let us know how that goes.

    Cheers!

    You guys are really useless been waiting for the resolution for the past 3 months, this code is not working

    Hi @jack52015 ,

    Please open your own thread and link this discussion so that we can help you properly with this matter.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Payment status stays on pending status, despite succesful payment.’ is closed to new replies.