7 replies [Last post]
daveX99's picture
Offline
Joined: 03/20/2010
Juice: 51
Was this information Helpful?

Hello:

I'm working on a site that is running on Drupal 6.26 & Ubercart 6.x-2.9. Credit card payments are processed via PayPal WPS.

The site sells a few shippable items, but is mostly selling downloadable files. The site has been working fine until a week or so ago. A customer would be able to order and pay for a file, and they would receive an email with a link to the file, no problem. Now something has changed and any orders are stuck at "Pending", even though Paypal has processed their payment. The error log shows repeated attempts by PayPal to send the IPN, but Drupal is not processing it.

I've googled this and been through the forums both here and at Drupal.org, and it seems common that my situation would be due to configuration errors. Nothing on our Drupal site has changed in many months, so I'm inclined to believe that something changed at PayPal or at our ISP (this is a shared hosting setup).

In any case, I've gone through my configuration and tried a number of things to no avail. The documentation for configuring WPS that's out there is old in a lot of cases, and contradictory, but from what I've read, I do NOT need to enable IPN Messaging in my settings at PayPal - Ubercart sends a request for an IPN response with each payment submission. I tried sending some test orders (to the live Paypal server, not sandbox), and got the same result whether IPN was enabled or disabled in the Paypal settings.

Here's a detailed description of the order process:

  • put through an order and paid with credit card at paypal
  • recieved an email from Paypal
  • Even though Auto Return is ON in the Paypal settings, I was not automatically sent back to our site - I had to click the 'Return to website' link on Paypal.com in order to return. Until I did so, the order was listed as "In Checkout" (Under Store Admin->Orders (viewing ALL orders, not just active).
  • Clicked the 'Return' link and was sent to our custom cart completion page.
  • I received an email from our website "Your order at [Store Name]", and order was updated to "Pending"
  • I DID NOT receive an email with a link to the downloadable file
  • Recent Log Entries shows that Paypal is sending the IPN over and over:
    Recieving IPN at URL for order [Order-number]
    This accompanied in the log each time with a 'Page not found' error:
    errors/500.shtml
  • Past orders that were successful are usually accompanied by a uc_paypal message:
    IPN transaction verified
    ... but this is NOT happening all of a sudden.

  • If I go to view the order in question and manually update its status from Pending to Payment Received, this action triggers the email with the download link, and the order is then set to Completed automatically.

So the issue is that PayPal is sending the IPN, but it is not being processed correctly by Ubercart. Until recently, the IPNs were working fine, and I don't believe anything has changed on our site. In fact the Ubercart and Drupal Core and some other modules were out of date when I began investigating this problem but updating all modules to their latest has not helped.

My client contacted Paypal and they told her that our server is giving us a HTTP response of 404 when we try to deliver the IPN. We are looking for a response of 200 and anything else will trigger it to retry until it actually fails out. It will retry 16 times over a 4 day timeframe.

I'm not aware of why that would change. The IPNs are being sent to oursite.com/uc_paypal/ipn/[order-num], as they always have been sent.

I would appreciate any help or suggestions that might be available. I would be happy to provide more information if necessary.

Thanks,
-dave.

daveX99's picture
Offline
Joined: 03/20/2010
Juice: 51
Paypal will disable IPN over failures.

I don't like to be pushy... but I've been unable to solve this or troubleshoot the issue. Paypal has sent a message saying that its IPN messages are failing and if it continues then they will disable IPN on my client's account.

Any help would be appreciated.

-dave.

longwave's picture
Offline
Joined: 09/20/2008
Juice: 580
Re: PayPal IPN not processed, order left at Pending

"errors/500.shtml" is not a usual page in Drupal or Ubercart and suggests your web server is redirecting to this page when an internal error occurs.

Are there any other errors recorded in the log? Do you have access to your webserver's error log files, which may contain more info?

--
These forums are for general support questions about Ubercart.
Bug reports and feature requests should be posted at http://drupal.org/project/issues/ubercart
Latest API documentation can be found at http://api.ubercart.me/

daveX99's picture
Offline
Joined: 03/20/2010
Juice: 51
uc_paypal/ipn 404 fail -- Log info,etc.

Thanks, longwave.

As far as messages related to orders, there are no 'errors' in the Recent Log Files, only the 'page not found' for 500.shtml, which is a 'warning'. This is always preceded by notification that uc_paypal is receiving an ipn message.

Maybe I should focus a bit on the request for 500.shtml -- Who is requesting that, where is that request generated? I do have access to the webserver logs, but they are a bit of a mess as this is shared hosting, so: shared log files (hooray!). I've filtered them, and downloaded the logs.

Looking thru those, I can see the requests for the uc_paypal/ipn 'page':

[14/Jun/2012:01:00:11 -0700] "POST /uc_paypal/ipn/188 HTTP/1.0" 404 5759 "-" "-"

You can see the 404 fail response. What I do NOT see is any request for this 500.shtml file. Is it generated from within Drupal somewhere? (The calls... They are coming from INSIDE the house! ... sorry, I'm punchy @ this hour).

Ultimately, the most frustrating thing is that we were getting and processing orders fine up until the late part of May, when something changed. I don't think it was our Drupal site, as I had not run any updates for some time (I have since updated a few modules, plus core, in hopes of maybe fixing this). Basically this means a change at either our ISP or at PayPal has caused this change in the behavior of uc_paypal.

I'd be happy to provide more info - just ask. Thanks for the help!

-dave.

dooogiee's picture
Offline
Joined: 07/05/2012
Juice: 9
Hi Dave, I'm just wondering

Hi Dave,

I'm just wondering if you've had any luck with this issue? Would really appreciate you filling me in if you found a solution?

I've just launched a website that originally was just going to be subscription orders, and the IPN worked fine for them. At the last minute I added some non-subscription products assuming everything would still be fine, but I've just had my first non-sub product order come through and the IPN never worked. About to do a whole load of marketing and (hopefully) get a lot more orders, so really would like to get it working so I don't have to update orders manually!
(Had some subscription orders and it worked fine on them)

Thanks,
Doug

daveX99's picture
Offline
Joined: 03/20/2010
Juice: 51
Problem was my ISP...

Longwave, Doug, et al.:

After a long struggle, it turns out the problem was at my ISP after all. They had made some changes to the shared hosting set up and unfortunately weren't really describing the details. They kept talking about one thing (turning off directory listings), which I knew had nothing to do with the problem, but never shared the fact that they'd changed some stuff in their PHP config -- which did have an effect. They finally came back today (after a month of calls & emails and me digging thru code), and suggested a one line change to my .htaccess file and that fixed it. Grr.

So there's nothing wrong with Drupal or Paypal at this point. Sorry I can't point to anything more helpful for you Doug... if you haven't already, you should open a separate thread for your issue. It might be a conflict between the kinds of products (but I'm really just talking out my butt, here...).

-dave.

dooogiee's picture
Offline
Joined: 07/05/2012
Juice: 9
Re: PayPal IPN not processed, order left at Pending

Ah okay, thank you for updating us and I'm glad you managed to sort it out!

daveX99's picture
Offline
Joined: 03/20/2010
Juice: 51
A minor update...

I just received a PM from a user asking what change I made to the .htaccess file to solve my problem. I'm sorry I wasn't more specific back in July. The reason I didn't bother explaining is that it is very specific to my ISP.

By default users on their simple shared hosting (as I'm using for this client) have PHP 4 available by default. In order to get to PHP 5 (like the rest of the 21st century), you have to add a line to the .htaccess file specifying a path to that, so I had added
Action php-cgi /cgi-bin/php5
to the top of my .htaccess file. In the update that they performed (and neglected to think of when I called about this...) they re-named the directory. So the line I changed was the one above, but now it reads:
Action php-cgi /cgi-bin/php53

So, as I said this is particular to my ISP, but on the slim chance it will help somebody else (or maybe at least give them a clue), I thought I should spell out exactly what worked in my case.

Thanks.

-dave.