2

based on Paypal tutorial, this is the form they provide for testing the IPN:

<form target="_new" method="post" action="https://www.YourDomain.com/Path/YourIPNHandler.php">
  <input type="hidden" name="SomePayPalVar" value="SomeValue1"/>
  <input type="hidden" name="SomeOtherPPVar" value="SomeValue2"/>

  <!-- code for other variables to be tested ... -->

  <input type="submit"/>
</form>

I got my IPN listener code in server/routing.js and used iron router and specified the path to /ipn. here is the code for it

Router.map(function () {
    this.route('ipn', {
        path: '/ipn',
        where: 'server',

so my question now, what URL should i put in the form instead of "https://www.YourDomain.com/Path/YourIPNHandler.php" URL? Because am testing it in my local machine "localhost:3000"

user3420180
  • 254
  • 2
  • 9
  • Possible duplicate of [How to test Paypal IPN listener?](http://stackoverflow.com/questions/36034987/how-to-test-paypal-ipn-listener) – sdooo Mar 16 '16 at 14:33
  • @Sindis have you read through my question? it is different, and am using the links in that question because am the one who asked that question, thanks :) – user3420180 Mar 16 '16 at 14:38

1 Answers1

4

I had the same problem friend. The solution was very simple. Paypal does not allow test in your local machine: Paypal says: We're sorry, URL with port number is not allowed for IPN. You must have a server with your "www.YourDomain.com". In my case for development tests I downloaded a "tunnel" application called NGROK which gives to you a testing domain. You can get it from here. Then will be enought just open the ngrok console and write the command:

> ngrok http -host-header=localhost 3000

After that execute your web application. After you've started ngrok, just open http://localhost:4040 in a web browser to review your domain provided by ngrok. When you go to localhost:4040 in your browser ngrok show to you a http and http domains like they show in the examples.

http://92832de0.ngrok.io 
https://92832de0.ngrok.io

Now just replace "www.YourDomain.com" with this ngrok URL.

Hope this helps to you. Regards!

Ivan Rascon
  • 157
  • 9
  • yes it helped, thanks. One question, the link i will use would be "http://92832de0.ngrok.io/ipn" or "http://92832de0.ngrok.io/routing.js" – user3420180 Mar 16 '16 at 14:50
  • Excellent, "92832de0.ngrok.io/ipn" will be your request URL. Now you also can inspecting your traffic on the localhost:4040 and access from anywhere to "92832de0.ngrok.io/ipn" – Ivan Rascon Mar 16 '16 at 14:55
  • @Ivan Rascon what is the command to use in Mac? when i user "./ngrok http" nothing happens – Behrouz Riahi Mar 16 '16 at 14:58
  • If you have already installed ngrok, use the command "help" to show the options, also check it: http://stackoverflow.com/questions/30188582/ngrok-command-not-found – Ivan Rascon Mar 16 '16 at 15:01
  • @IvanRascon can you please check this question and help me if you came across the same problem http://stackoverflow.com/questions/36043368/error-cannot-find-module-paypal-ipn – Behrouz Riahi Mar 16 '16 at 18:34
  • I have created a more detailed explanation on how to proceed here. https://stackoverflow.com/questions/24224196/how-to-test-paypal-ipn-notification/62297068#62297068 – 8ctopus Jun 10 '20 at 06:22