将PayPal返回URL设置为localhost [英] Setting PayPal return URL to localhost

查看:63
本文介绍了将PayPal返回URL设置为localhost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试整合Paypal,并在此过程中使用沙箱.我在以下问题中按照公认的答案进行操作. 设置PayPal返回URL并使其自动返回?

I'm trying to integrate Paypal and I'm using sandbox in the process. I follow the step of the accepted answer in the below question. Setting PayPal return URL and making it auto return?

但是当我尝试输入URL时,Paypal返回以下错误.

But when I try to enter the URL, Paypal return the below error.

We were unable to validate the URL you have entered. Please check your entry and try again.

我要设置的URL是http://localhost:8888/paypal/success.php.

我尝试使用以下形式发送返回网址.

Also I tried sending the return url with the form as below.

<input type="hidden" name="return" value="http://localhost:8888/paypal/success.php">

这两种方法都不适合我.

Both methods does not work for me.

完整格式

<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" value="dasun_1358759028_biz@archmage.lk" name="business">
<!-- Specify a Buy Now button. -->
<input type="hidden" value="_xclick" name="cmd">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" value="AM Test Item" name="item_name">
<input type="hidden" value="22.16" name="amount">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" value="item_number" name="item_number">
<input type="hidden" name="return" value="http://localhost:8888/paypal/success.php">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form> 

如何在我的开发PC上进行测试?

How can I test this on my development pc ?

推荐答案

如果您尝试指定IP地址而不是本地主机怎么办?

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

无法在远程计算机上解析本地主机.只有本地DNS知道localhost语句,并且是127.0.0.1.

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

这篇关于将PayPal返回URL设置为localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆