【问题标题】:Testing Paypal IPN locally在本地测试 Paypal IPN
【发布时间】:2016-07-02 11:22:14
【问题描述】:

基于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 侦听器代码,并使用了铁路由器并指定了/ipn 的路径。这是它的代码

Router.map(function () {
    this.route('ipn', {
        path: '/ipn',
        where: 'server',

所以我现在的问题是,我应该在表单中输入什么网址而不是“https://www.YourDomain.com/Path/YourIPNHandler.php”网址?因为我在我的本地机器“localhost:3000”中测试它

【问题讨论】:

  • @Sindis 你读过我的问题了吗?它是不同的,我正在使用该问题中的链接,因为是提出该问题的人,谢谢:)

标签: meteor paypal paypal-ipn


【解决方案1】:

我有同样问题的朋友。解决方案非常简单。 Paypal 不允许在您的本地计算机上进行测试:Paypal 说:很抱歉,IPN 不允许使用带有端口号的 URL。 您的“www.YourDomain.com”必须有一个服务器。在我的开发测试案例中,我下载了一个名为 NGROK 的“隧道”应用程序,它为您提供了一个测试域。您可以从here 获得它。 然后就够了,只需打开 ngrok 控制台并编写命令:

> ngrok http -host-header=localhost 3000

然后执行您的 Web 应用程序。启动 ngrok 后,只需在 Web 浏览器中打开 http://localhost:4040 即可查看 ngrok 提供的域。 当您在浏览器中访问 localhost:4040 时,ngrok 会向您显示一个 http 和 http 域,就像它们在示例中显示的那样。

http://92832de0.ngrok.io 
https://92832de0.ngrok.io

现在只需用这个 ngrok URL 替换“www.YourDomain.com”。

希望这对您有所帮助。问候!

【讨论】:

猜你喜欢
  • 2010-11-10
  • 2013-09-20
  • 2011-11-01
  • 1970-01-01
  • 2012-07-13
  • 1970-01-01
  • 2017-11-09
  • 2013-08-28
相关资源
最近更新 更多