贝宝沙盒 - 通知 url 问题

Paypal Sandbox - notify url issue

我正在开发在线商店应用程序,但我很难将订单信息接收到通知 url。在 this documentation 之后,我创建了我的贝宝表格:

<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
  <fieldset>
    <input id="buy" name="submit" type="submit" class="btn btn-primary" value="Buy" id="">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="test-facilitator@gmail.com">
    <input type="hidden" name="item_name" value="My online store">
    <input type="hidden" name="currency_code" value="EUR">
    <input type="hidden" name="amount" data-bind="value: amount"> 
    <input type="hidden" name="notify_url" value="myurl/notify">
    <input type="hidden" name="return" value="myurl/return">
    <input type="hidden" name="cancel_return" value="myurl/cancel">
 </fieldset>
</form>

其中 "myurl" 类似于 http://78.83.22.112。我是 运行 我在本地 apache 服务器上的应用程序。 Return 和取消 url 正在按预期工作,但 Paypal 似乎无法调用我的通知 url。我正在使用 Laravel 4 开发我的应用程序,所以这是我在 routes.php 中管理我的通知 url 的方式:

Route::post('/notify', 'CartController@notify');

这是我的通知方法:

public function notify() {

    Log::info("Notify hit");

}

在IPN模拟器中测试了我的通知url,结果是

We're sorry, we could not connect to this URL. Please make sure it was entered correctly.

我做错了什么?为什么沙盒无法调用我的通知 url ?

听起来像是防火墙问题。请记住,取消和 return URLs 是 PayPal 将 you 发送到 URL 的地方。我一直定期针对内部非路由 URL 进行测试。 PayPal 只是将您的浏览器发送到您指定的位置,而不会验证是否有人可以访问它。

IPN 是另一回事。 PayPal 的服务器必须能够连接到您指定的 URL。在这种情况下,您需要打开端口 80(http),以便外部用户可以连接。 Microsoft 有 instructions on how to open a firewall port(Windows 7 但与 8.1 等类似)。

所以经过3天的战斗终于解决了这个问题。我没有在浏览器中输入 "localhost",而是输入了我的外部 IP——我要发送到 Paypal 的 IP,以测试我的应用程序。我的通知 URL 被调用成功。不知道为什么,但这解决了问题。