2013-05-13 56 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属性。