Setting PayPal return URL to localhost

左心房为你撑大大i 提交于 2019-12-05 03:22:38
Andrew Adamich

What if you try to specify your IP address instead of localhost?

Local host cannot be resolved on distant machines. It's only your local DNS which knows localhost statement and is 127.0.0.1.

http://your-IP-address:8888/paypal/success.php

You can create some URL alias for your website and add it to your hosts file (http://en.wikipedia.org/wiki/Hosts_(file)). Then pass that URL as your return URL to paypal. They just trigger a re-direct within the browser to that location at which point your host file will resolve it to your local development server.

For Example: Add a line to your hosts file like 127.0.0.1 local.mywebdomain.com

Then in your PayPal button, pass that same URL for the return parameter (e.g. <input type="hidden" name="return" value="http://local.mywebdomain.com/success.php">)

You can't use localhost it's not a valid URL, PayPal can't access your local enviornment.

Best way is to upload the form and return script to the web, there's a number of free PHP web hosts out there if you don't have one.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!