1
votes

i am trying to implement paypal payment system on my website. i am kinda stuck at receiving IPNs. the website is developed in PHP, on ZendFramework and Doctrine 1.2.3

i used the example script located on paypal site for receiving IPNs, however it doesn't work. for debugging purposes i left on the IPN page code that just inserts a new entry in a table in my mysql db, so every time i load the page, a new entry is inserted in the DB.

i tried again to use Instant Payment Notification (IPN) simulator from PayPal and try to send a new IPN to that page, however nothing is inserted in the DB, so my best guess is somehow paypal can't reach my page, even though it says IPN successfully sent.

the ipn url is something like: http://mydomain.com/shop/paypal/ipn

2
We probably need more info to give you a good answer, otherwise I'd just be naming off possible errors.Gohn67
Anyway, I'd first check if you are getting a response, by checking your log files and seeing if you're getting a post request from paypal or if there was an error.Gohn67
Also in your Sandbox account, you have to make sure IPN is enabled. You probably have done that already, but I'm just going through the obvious.Gohn67
Also I thought the IPN request was a POST request and not a GET request. Also if you happen to be using shared hosting from GoDaddy, they don't allow POST requests from 3rd party servers.Gohn67
IPN is on in sandbox account. i just checked the IPN history, everything is ok there, HTTP response is 200private

2 Answers

0
votes

i finally got it. as it seems, paypal does not send IPN data to urls like: domain.com/shop/ipn . i created a separate php file, not related to the framework i use so the ipn url looks like: domain.com/ipn.php . now everything works.

0
votes

I am getting back with a proper answer. The reason it didn't work wasn't any paypal ipn url-form restriction.i used Zend_Translate for multilanguage suport and used as default language what the visitor browser was sending me back.problem was when paypal was sending me IPN it did not provide any default language, which generated an exception in my code and an application crash, so no IPN got received.

Furthermore, if anyone needs to have custom URLs in Zend they can use Zend_Controller_Router_Route_Regex, more information here:

http://framework.zend.com/manual/1.10/en/zend.controller.router.html#zend.controller.router.routes.regex