Pages

Tuesday, May 19, 2015

Locally debugging Paypal's Instant Notification Payments via ngrok

I was working on a personal project and needed to accomplish some specific requirements when clients purchased an item from the website. Now, Paypal has something called Instant Payment Notification (IPN) which is a mechanism by which Paypal makes an Http Post to any url you choose, and in that post it sends you some vital information about the financial transaction (more information on Paypal's IPN here).

The problem that I was having was that I was not able to locally debug the code that I had written for the URL that would receipt Paypal's Http Post, and the reason is that in your Paypal's business account, you are not allowed to enter a "localhost" type of url. So when you go to Paypal, log in and go to Profile -> My Selling Tools -> Instant Payment Notifications, you can then specify the URL where Paypal will post the requests and this URL is not allowed to be localhost.