我正在使用此表单在paypal沙盒网站上提交请求:
<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_EMAIL
和MY_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错误,我认为当我从沙箱切换到真正的贝宝时,我不会在那里。)
问题是:订单已正确放置,在我的沙箱帐户中我收到付款
Hello Test Store, You received a payment of €13.00 EUR from xxx xxx (xxx@test.test)
但在我的error_log中我看到了:
payment_status Pending
如果payment_status
设置为Pending
,我是否应该对我的ipn.php文件进行编码,使其接受并传送数字商品?我遵循的指南建议仅在payment_status为Completed
时才这样做。
为什么paypal沙盒服务器没有向我发送确认信息?
答案 0 :(得分:0)
解决 - 只需登录您的沙盒企业帐户,然后从那里开始接收不同货币的付款或/并接受付款。然后,您的IPN将正确接收“已完成”的payment_status属性。