8

I need to test a new PayPal integration with my application. I use PayPal sandbox in development env.

In order to test the entire interface, I figured out that ngrok might solve the problem of messages from PayPal.

I installed ngrok using apt-get install ngrok-client on my new Ubuntu 16.04 instalation.

When I try to run it (ngrok 3000, ngrok 80) I get the following error:

Invalid address server_addr 'ngrokd.ngrok.com:443': lookup ngrokd.ngrok.com: no such host

Any idea?
Any other solution to test PayPal integration?

==================== EDIT ==================

Very important - if youi use Rails 4.2.0, have a look at this tutorial, it might save you some hours of frustration:
https://www.youtube.com/watch?v=YXKNxEv35HU

guyaloni
  • 4,972
  • 5
  • 52
  • 92
  • 1
    I'd eliminate the use of PayPal from your tests entirely. Stub out the methods instead of actually calling anything. Then reproduce the various responses you expect from PayPal. Otherwise what you're testing is PayPal's API. – jaydel Jun 29 '16 at 15:52
  • Good advice for automated unit tests, but I get the sense that OP is just exercising code paths manually, and ngrok is great for that. – johncip Sep 25 '16 at 06:10

3 Answers3

19

Try to Run ./ngrok http 3000 in the Directory where your Ngrok executable file is placed.

Subhash Chandra
  • 3,165
  • 1
  • 27
  • 30
  • 4
    `whereis ngrok` returns `/usr/bin/ngrok`. When I try what you suggest I get `You may only specify one port to tunnel to on the command line, got 2: [http 3000]`. With only `3000` I get the same error. – guyaloni Jun 29 '16 at 11:18
  • 2
    Can you Please try https://ngrok.com/ and download Your Os Executable and put it into home directory, and then run the command i told you in home directory through terminal, it is working this way for me since long time. – Subhash Chandra Jun 29 '16 at 11:27
  • 1
    Thanks, now I can manage initiating the ngrok server. But now I have another problem - I use subdomains in my application and ngrok tells me that "Only paid plans may bind custom subdomains"... :-( – guyaloni Jun 29 '16 at 11:45
  • hmm, looks like that's only revenue source for ngrok but temporarily for paypal testing you can test from ngrok url instead of subdomains. – Subhash Chandra Jun 29 '16 at 12:55
8

I ran into this when trying to install ngrok with apt-get on Ubuntu 14.

The packaged version (1.6) no longer works, because service for ngrok 1.x was discontinued in April 2016.

The ngrok 1.X service has shut down and all users are encouraged to upgrade to ngrok 2.0.

The easiest way to continue using ngrok is to upgrade to 2.0. ngrok 2.0 has been available for nearly a year and it is a faster, more stable and more powerful tool. I hope that you'll love it even more than the original.

Ubuntu 16 also ships ngrok 1.6, unfortunately.

The current version available for download at ngrok.com is 2.1.3, which works fine. ngrok is a single executable file, so all you need to do to install it is unzip and put it somewhere on your PATH.

Community
  • 1
  • 1
johncip
  • 2,087
  • 18
  • 24
4

I supposed you installed ngrok from package manager with this command

$ sudo apt-get install ngrok-client

But it no longer work because it's the 1.6 version.

You have to download a new version on official page. Then you can run it like this:

$ ./ngrok http 3000
alexandre-rousseau
  • 2,321
  • 26
  • 33