Welcome to WebmasterWorld Guest from 23.22.17.192

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PayPal IPN problem (on Joomla site)

script executes fine but returns 503 code

   
7:38 pm on Aug 13, 2011 (gmt 0)

5+ Year Member



It seems to be a common problem (I see a lot of questions about this on the net). My IPN script works perfectly. it does everything it is supposed to, except that it returns a 503 to PayPal instead of a 200. So PayPal keeps resending the IPN.
I looked at my server logs and sure enough the page in question returns a 503 when called from PayPal (but when I call it manually by typing the address it doesn't.
Despite it being a common problem however I have yet to find the reason why it does this.
I know a 503 means "Service Unavailable" but why would a page throw this error while it still executes perfectly?
The only reason I can think of in my case is because I use Joomla and my IPN url is www.somedomain.com/index.php?option=x&view=y
So in effect I am not calling a physical page; but that shouldn't matter now should it?
12:37 pm on Aug 18, 2011 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Unless I am missing something here it looks as if you will have to trace back through that Joomla code to figure out where and when the 503 is being served.
1:00 pm on Aug 18, 2011 (gmt 0)

5+ Year Member



I got it working by placing my handler code in a page that can be accessed directly by the IPN (so no use of a query-string). I did multiple tests with PayPals sandbox IPN-tool and found that any URI with a query-string (on a Joomla site at least, I didn't test non-joomla sites) gave me a 503.
I re-wrote my handler to work outside of the joomla install as a workaround. I'm not sure how I could backtrace to see where the 503 originates. But frankly I am happy I got it working now and I will see if I can revisit this in my own time once this project is done.
1:05 pm on Aug 18, 2011 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Backtrace by monitoring your network traffic (wireshark is a good graphical tool for this) and by running a debugger. You will find the exact script and line and you can work at it from there.
1:13 pm on Aug 18, 2011 (gmt 0)

5+ Year Member



Thanks, I'll check it out.