• Resolved zahost

    (@zahost)


    Hi,

    I’m having a problem with my order status not updating. I’ve contacted PayFast and they confirmed that all the ITN’s were sent successfully on the first try. I’m getting the payment notification emails from PayFast, but my order status remains as “pending” which turns to “cancelled” after some time. Customers are correctly redirected to PayFast and returned to my site.
    Everything works perfect in sandbox mode. The order status is updated to “processing” and all the emails are triggered. It is only on the live side that my order status is not updated, hence no emails triggered, which is causing a lot of time consuming manual status updates.

    It seems to break down only on the live deployment. I have no idea if it is a PayFast plugin bug, or something else entirely. It is limited to the order status update only. Everything else works fine.

    System info:
    WC Version: 3.6.5
    WP Version: 5.2.2
    PHP Version: 7.0.33
    MySQL Version: 5.6.41-84.1
    WooCommerce PayFast Gateway: by WooCommerce – 1.4.12
    OceanWP Version: 1.6.8

    Can someone please assist me with this issue?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    Hey @zahost,

    Do you have the PayFast Notify URL hard-coded within your PayFast merchant account? It is perhaps pointed to the Sandbox site instead of the live site?

    If it’s set up properly to point to the live site, you’ll want to check the access logs for your live site; your server may be blocking the ITN requests from PayFast.

    Thread Starter zahost

    (@zahost)

    Hi Thomas,
    Thanks for your reply.
    Yes. The URL is hard-coded in my merchant account. I’ve confirmed with PayFast support that the URL for sandbox and live deployment remains the same (https://YOURWEBSITEURL/?wc-api=WC_Gateway_PayFast) If the server is blocking the ITN, it will do so in sandbox as well. PayFast did confirm that the ITN’s were delivered successfully on the first try on all the transactions so far. It seems as if the PayFast plugin is not passing the information to woocommerce in the live deployment.

    As I was typing this reply, Rynaldo from Automattic directed me to put the following code in a snippet (or the functions.php of the child theme) which seem to have solved the order updating issue…

    add_filter( ‘woocommerce_gateway_payfast_is_valid_ip’, ‘__return_true’ );

    It seems like the PayFast URL was not validated by the system on the return of information from PayFast. The above line of code solves that.

    For anybody else having this issue:
    I pasted the line of code in a new snippet in the “Code Snippets” plugin. It can be named anything. Just paste the line and nothing else. Save and activate the snippet. I hope this helps someone else searching for days on end for a solution…

    Aahh, finally! This is definitely the solution. Thank you very much. WC should include this in the payfast plugin

    • This reply was modified 4 years, 6 months ago by vusisindane.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PayFast ITN sent successfully, but order status not updating’ is closed to new replies.