2012-07-04

PayPal Instant Payment Notification (IPN) Simulator Requires Port 80

Someone please correct me if I'm wrong, but I fought for an hour or more trying to get PayPal's Instant Payment Notification (IPN) Simulator to post test transactions to my test site running on IIS Express which listens on a port different than 80; and it just doesn't work.

I asked friends on external networks to bring my site up in their browsers and they could hit it fine on the non-standard port, so I knew my firewall and IIS Express were configured correctly.

I cannot find anywhere in PayPal's documentation where it states that port 80 is required but it seems their own firewall is pretty strict with outbound traffic.  Once I forced my router to listen on port 80, and forward the request to the non-standard port my site listens on, the simulator worked like a champ.

So, if you're having problems with the IPN simulator not sending to your listener and you are listening on a non-standard port, make sure to do one of the following:

  1. Force your test site to listen on port 80 and configure your firewall accordingly.
  2. Force your router to listen on port 80, but forward to the port your test site is set up on.
That's what we like to see!
As a side note, if I remember correctly... the standard ASP.NET Development Server (Cassini) that comes with Visual Studio, does not accept requests from an external network.  I believe it can only accept them from the same machine you are doing the development on.  This is why I opted to use IIS Express.

Hope this saves someone else some time and head-banging on your desk.  :)
Happy coding!

6 comments:

Anonymous said...

To test IPN Simulator setup application with default port. Doesn't work with 8680 port and it was quite hard to find the problem.

That One Guy said...

@Anonymous: were you able to get it to work with port 80?

Anonymous said...

Thanks a lot!
It's really helped me too)
I did not find any info in paypal manuals about port 80.

Anonymous said...

$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);

That One Guy said...

@Anonymous (with the $fp code):
I assume that is for calling the Simulator via PHP, but on the callback, are you still required to use port 80?

Or does it try to call your callback URL on 443? (And if so, is 443 your only option?)

Unknown said...

Great googley moogley, I spent an entire day trying to get mine to work on a test site using port 8888! I was ready to completely jack in being a developer and go back to working in a bank. The moment I change my site back to the default port 80, and it works! Why the hell is this not in PayPal's knowledge base!?!