簡體   English   中英

貝寶沙盒-通知網址問題

[英]Paypal Sandbox - notify url issue

我正在開發在線商店應用程序,並且很難在我的通知URL中接收訂單信息。 根據此文檔,我創建了我的貝寶表單:

<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服務器上運行我的應用程序。 返回和取消URL正常工作,但似乎Paypal無法調用我的通知URL。 我正在使用Laravel 4開發我的應用程序,所以這是我如何在route.php中管理通知URL的方法:

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

這是我的notify方法:

public function notify() {

    Log::info("Notify hit");

}

在IPN模擬器中測試了我的通知URL,結果是

很抱歉,我們無法連接到該URL。 請確保輸入正確。

我究竟做錯了什么 ? 為什么沙箱無法調用我的通知URL?

聽起來像是防火牆問題。 請記住,取消和返回URL是PayPal將發送到URL的位置。 我經常對內部非路由URL進行測試。 貝寶只是將您告訴瀏覽器的位置發送給您的瀏覽器,而不會驗證是否有人可以訪問它。

IPN是另一回事。 PayPal的服務器必須能夠連接到您指定的URL。 在這種情況下,您需要打開端口80(http),以便外部用戶可以連接。 Microsoft已說明如何打開防火牆端口 (Windows 7,但與8.1類似,等等)。

因此經過3天的戰斗終於解決了這一問題。 我沒有在瀏覽器中鍵入“ localhost”,而是鍵入了我的外部IP,即我發送給Paypal的IP,以測試我的應用程序。 我的通知URL稱為成功。 不知道為什么,但是這解決了問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM