基于Paypal tutorial ,这是他们提供的用于测试 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>
我在 server/routing.js
中获取了 IPN 监听器代码,并使用 Iron 路由器并指定了 /ipn
的路径。这是它的代码
Router.map(function () {
this.route('ipn', {
path: '/ipn',
where: 'server',
现在我的问题是,我应该在表单中输入什么 URL 而不是“https://www.YourDomain.com/Path/YourIPNHandler.php ” URL?因为正在我的本地计算机“localhost:3000”中测试它
最佳答案
我的 friend 也遇到了同样的问题。解决方案非常简单。 Paypal 不允许在您的本地计算机上进行测试:Paypal 说:很抱歉,带有端口号的 URL 不允许用于 IPN。 您必须有一个带有“www.YourDomain.com”的服务器。在我的开发测试中,我下载了一个名为 NGROK 的“隧道”应用程序,它为您提供了一个测试域。您可以通过 here 获取。 然后只需打开 ngrok 控制台并编写命令即可:
> ngrok http -host-header=localhost 3000
之后执行您的网络应用程序。启动 ngrok 后,只需打开 http://localhost:4040在网络浏览器中查看 ngrok 提供的域。 当您在浏览器中访问 localhost:4040 时,ngrok 会向您显示 http 和 http 域,如示例中所示。
http://92832de0.ngrok.io
https://92832de0.ngrok.io
现在只需将“www.YourDomain.com”替换为此 ngrok URL。
希望这对您有帮助。问候!
关于meteor - 本地测试 Paypal IPN,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36038064/