2013-05-13 55 views
0

我用這種形式來對貝寶沙箱網站提出申請:貝寶IPN監聽器接收錯誤PAYMENT_STATUS

<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" 
    method="post"> 
    <input type="hidden" name="cmd" value="_xclick"> 
    <input type="hidden" name="business" value="MY_EMAIL"> 
    <input type="hidden" name="currency_code" value="EUR"> 
    <input type="hidden" name="item_name" value="Book!"> 
    <input type="hidden" name="amount" value="13"> 
    <input type="hidden" name="return" value="THIS URL"> 
    <input type="hidden" name="notify_url" value="MY_IPN"> 
    <input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" 
     border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> 
</form> 

我替換值只有MY_EMAILMY_IPN。後者,特別是我的ipn.php文件

include('ipnlistener.php'); 

$listener = new IpnListener(); 

// tell the IPN listener to use the PayPal test sandbox 
$listener->use_sandbox = true; 

// try to process the IPN POST 
try { 
    $listener->requirePostMethod(); 
    $verified = $listener->processIpn(); 
} catch (Exception $e) { 
    error_log($e->getMessage()); 
} 

error_log($listener->getTextReport()); 

(ipnlistener.php source is on github)的鏈接。當我下訂單時,一切都順利進行(除了Please login to use the PayPal sandbox feature錯誤,我認爲在我從沙盒切換到真正的PayPal時,這些錯誤不會存在)。

的問題是:爲了正確地放置在我的沙盒帳戶我收到支付

Hello Test Store, 

You received a payment of €13.00 EUR from xxx xxx ([email protected]) 

,但在我的error_log我看到這一點:

payment_status   Pending 

我應該如果payment_status設置爲Pending,則代碼我的ipn.php文件也可以接受並傳送數字商品?只有在payment_status爲Completed的情況下,我纔會遵循指導。

爲什麼PayPal沙箱服務器不向我發送確認?

回答

0

解決 - 只需登錄到您的沙箱企業帳戶,並從那裏啓用以不同貨幣接收付款或/並接受付款。您的IPN將會正確收到「已完成」的payment_status屬性。