Orders Stuck in Pending Payment in Magento Due to Paypal Disabling IPN

Geoff Jackson

Geoff Jackson (more commonly known by his online pseudonym zigojacko) is the founder of Design Haven and The Clubnet Group which hosts numerous agencies including the most widely recognised of them, Clubnet Digital, a full service digital marketing and creative design/development agency. He also has a personal blog but it doesn't get updated as much as he'd like.

You may also like...

Sponsored Links...

Subscribe to Design Haven UK

Enter your email address to subscribe and receive our new posts by email.

20 Responses

  1. Piers says:

    Hi Geoff,

    Thanks, that’s a great workaround to the problem. It’s working on PayPals IPN Simulator now using your script. Our PayPal IPN started failing, shortly after updating Magento to 1.9.1.1. Before then it worked fine.

    Do you have ideas to why Magento won’t handle this external request correctly?

    • Thanks for stopping by and taking the time to leave a comment Piers.

      So are you saying that in your instance, you only take payments via Paypal for your Magento store (and not other channels such as eBay and Amazon)?

      Generally, this isn’t a Magento issue, Paypal should allow businesses to add multiple IPN URL’s. Once you set an IPN URL for Magento in Paypal and then you take a payment via another channel, it can’t match the data against the IPN listener because the order never originated there.

      • Piers says:

        Yes primarily through PayPal.

        Indeed you are correct, after many hours of pain I discovered that the IPN simulator was reporting a successful response through your script, but actually it was not working in Magento’s back-end. I think I was getting desperate at the point of reading your post and would try anything and had lost the capacity to think!

        I have tried so many tricks and none of them worked. It turned out (believe it or not) that despite reporting a successful Magento upgrade, I got so fed up that I overwrote all the files in the core PayPal directory, went off and had dinner. Voila it started working, sending through IPNs within hours… DESPITE the IPN simulator still reporting HTTP error the next day.

        • Thanks for leaving a comment with an update Piers.

          I think you are saying that now your Paypal IPN is working? If so, great news.

          Yes, the central IPN listener in my post above is only really needed if there are IPN notifications coming from multiple sales channels.

          Magento can sure make us all get like you’ve described. Sometimes taking a break and coming back half an hour later can make all the difference in fact 🙂

  2. Mike says:

    Looked around for quite a while for this solution, thanks a lot. We have Amazon and Ebay so that was causing the IPN issues, added the file and now it’s updating, great work.

  3. Mark says:

    Hello,

    I am having IPN issues with out website. We use Paypal with ebay and have another website which I will be needing to link in to paypal soon too and Amazon is on its way 🙂

    How does this file work?

    If this file is created and the IPN pointed to it, will eBay and Amazon still get payment updates? Can a second website be added to this too?

    I could not see directly from the code how this could be done. Thanks for nay help

    • Sorry for not replying sooner Mark.

      This script acts a centralised IPN listener so it can support multiple channels taking Paypal payments.

      You just simply need to point your IPN notification URL to the location of this script from within your Paypal account.

      By pointing it to the default Magento URL (as documented in the post above), this causes Paypal to look in Magento for payments coming into the account from any channel and when it can’t find them, it throws an error behind the scenes and so many of these errors will cause Paypal to disable the IPN on your account.

      Hope that helps.

  4. Haim says:

    Hi Geoff, Thanks for the script, I had seen something similar elsewhere but wasn’t sure how updated this was. Do you know if this would work for Magento EE 1.12.0.2

    • Hey Haim, sorry for the delayed reply. This has been used and tested, confirmed working up to Magento CE 1.9.x. I’d expect it to work in EE 1.12.x although I can’t say I have implemented it in EE to be sure though.

      Hope that helps 🙂

       

  5. Al says:

    Geoff, you have saved the day!

    Following a server move our transaction ID was empty. Spent (literally days on this issue) looking at the code, and playing ping pong support tickets with server technicians.
    As it had been associated with the move I was focussed on our new hosting environment or permissions, or code not working on new php version… rather than what seems so obvious now ive read your post!

    Thanks a million for taking the time to write your solution up for us all to benefit.

    Al

  6. Bubai Dey says:

    Hello Geoff,

    Due to “PayPal Instant Payment Notification” Warning I have disabled IPN notification from paypal. But I am facing magento order status is stuck, showing “pending payment” after Disabling IPN. If I add provided code in root, do I need to enable IPN notification in paypal?

    Thanks

    • Hey Bubai,

      Magento requires that you have the IPN in Paypal set and enabled otherwise Paypal cannot communicate back to Magento to confirm that payment has been received after a Paypal sale in Magento therefore, the order is unable to proceed past ‘Pending’ status.

      If you have used the central IPN listener in this article, you will need to set the Paypal IPN URL to the location of this file, i.e. http://www.domain.com/null_ipn.php.

      Does that help explain things?

      • Bubai Dey says:

        Hi Geoff,
        Thanks for your valuable reply, but when i am going to enabled bellow warning received from paypal –
        “Please check your server that handles PayPal Instant Payment Notification (IPN) messages. Messages sent to the following URL(s) are not being received:

        https://mumsandbabes.com/index.php/paypal/ipn/

        If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information.

        Once you or your service provider fix this problem, you or your service provider can resend the failed messages from the IPN History page. If this problem continues, PayPal may disable the IPN feature for your account.”
        Thanks

        • Are you accepting payments via Paypal through either eBay or Amazon in addition to your Magento store Bubai?

          If so, then that will be why you are experiencing problems with the default Magento IPN URL and you would have to implement a centralised IPN listener exactly as explained in my article above…

  7. Emily says:

    Hi Geoff, Great Article… do you have any update to this that would apply to Magento 2.1.9 ? Thank you!!

    • Hey Emily, thanks for stopping by and leaving a comment. I am very sorry, but at this present moment in time, I haven’t got a Magento 2 equivalent of this article but I shall try and schedule some time in soon to take a look at this on Magento 2 and write an updated post. I assume it is the same symptoms in Magento 2 of the IPN getting disabled due to multiple sales channels trying to talk to Magento causing sales to get stuck in ‘Pending Payment’ status?

      • Emily says:

        Hi Geoff, Thanks for the super fast response! At first I thought it might be the same issue… but I figured it out. Looks like the boss changed what email was the primary at Paypal. 😉 So it seems we are good again now.

  1. May 15, 2015

    […] Orders Stuck in Pending Payment in Magento Due to Paypal Disabling IPN I found this article really useful creating a centralised IPN listener and it was working with the IPN simulator, sending/receiving a response. However, it did not solve the problem. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: