HowTo: Testing PayPal from LocalHost ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I'm trying to test the PayPal plugin LOCALLY ..meaning from my Visual Studio "localhost".
I cannot set a return URL on PayPal as "http://localhost/xxxx" for obvious reasons.

So what is the recommended way to test locally a PayPal plugin ?
12 years ago
FYI:  I am using Nop 1.9

If I remember correctly (it was awhile ago I did this), when I was testing PayPal they have a Sandbox for developers where you can set up fake buyers and fake sellers with accounts and fake credit cards to do your testing.  developer.paypal.com.  When I tested it, I used the fake seller credentials I created to logged onto the sandbox PayPal site and used the fake buyer when my website sent me to "PayPal" during checkout.  If I remember, I didn't use localhost but deployed to my server and tested.  When I was satisfied that everything worked, I changed the PayPal API credentials in the Admin site from the fake seller in the sandbox to the real API credentials for the live PayPal site.

Hope this helps.
12 years ago
Yes that makes sense ...but i need to test locally before I put the whole site up on a server.
So instead of installing Visual Studio on the server, I was hoping somebody would have a way to handle properly that "return" URL.

F.
12 years ago
Hmmm.....we have used development servers in the past to deploy and test before moving to a production server.  Don't know if you have that option.   Another possibility would be to create an A record in the DNS entry for your local machine and use the fully qualified name rather than 'localhost'.   If your behind a router you may need to port forward to your local machine.
12 years ago
Interesting idea ....
but i was under the impression that "PayPal" was the one redirecting back to a URL that you set on the PayPal account.

So I'm not sure that a server in Connecticut, running PayPal site knows that http://localhost:1234/NopCommerce ...is the actual IP address of my machine.

Or ..am I really missing something here ??
12 years ago
You are correct about PayPal.  What I was thinking is: if you have a domain you could log onto the hosting company and create a DNS entry A record for a testing domain name , like 'test.yourdomain.com'  that points to the IP address of your local testing machine.  If you are behind a router, you would need to use the WAN IP address for the router and port forward (HTTP 80) to the internal machine (e.g. 192.168.0.12).  So, instead of entering http://localhost//somepage.aspx  at PayPal you would use http://test.yourdomain.com/somepage.aspx in the PayPal return address.  That should go to your localhost machine on the return.   What I am not sure about is if it makes a difference to PayPal if the initiating domain for the interaction is 'localhost' but the return is different.  I don't think so, but you could try.
12 years ago
Ohhh i see ...good idea !!
I was actually trying to use something like dyndns.org locally.

I'll try that.
Thanks for the suggestion
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.