我正在测试沙盒中的IPN。在我的网站上,我在Paypal和我的网站之间记录此通信
Start validations:_notify-validate,16.94,Eligible,confirmed,SVWAAUVZX2S4Y,0.00,1 Main St,13:57:50 May 07, 2012 PDT,Completed,windows-1252,95131,Test,0.84,US,Test User,3.4,,verified,demarc_1336421374_biz@gmail.com,United States,San Jose,1,As4zhnwQeMSnsOdh0NBxc2GkfRrEAd8OPZnnd3EWRDz38L81PzX-6vI- ,demarc_1321350258_per@gmail.com,6FT25620DT6366410,instant,User,CA,demarc_1336421374_biz@gmail .com,,6SHJZ2PT5YMLS,web_accept,test item,EUR,,US,1,0.00,test item,,0.00,de0561482901
2012-05-07 22:52:47 Paypal: ResponseVERIFIED
2012-05-07 22:52:47 Paypal: 1
2012-05-07 22:52:47 Paypal: Processing Trasaction: 4fa8361f-7574-444f-b821-5e660a00000f
2012-05-07 22:52:47 Paypal: 4fa8361f-7574-444f-b821-5e660a00000f
好像好吗,呃?但是如果我使用商业帐户登录Sandbox,在IPN历史记录中,我看到Paypal正在尝试发送IPN。在我的网站上,我将事务记录到数据库中,我看到了很多记录(如果验证了响应,我会存储这些记录)。 这怎么可能? 我用cakephp回帖给Paypal function isValid($ data){
$data['cmd'] = '_notify-validate';
$newData['cmd'] = '_notify-validate';
foreach ($data AS $key => $val) {
$newData[$key] = $val;
}
$this->log("Start validations:".join(",",$newData), 'paypal');
$data = array_map(array('PaypalIpnSource', 'clearSlash'), $newData);
if (isset($data['test_ipn'])) {
$server = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
} else {
$server = 'https://www.paypal.com/cgi-bin/webscr';
}
$response = $this->Http->post($server, $newData);
$this->log("Response".$response, 'paypal');
if ($response == "VERIFIED") {
return true;
}
if (!$response) {
$this->log('HTTP Error in PaypalIpnSource::isValid while posting back to PayPal', 'paypal');
}
return false;
}
}
我不认为这是cakephp或其他任何问题。 我将沙盒业务帐户EUR设置为货币。此外,paypal提交表格中的货币价值为欧元。 经过几天的谷歌搜索后,任何帮助表示赞赏。
答案 0 :(得分:0)
您的IPN端点必须使用HTTP状态代码200回复PayPal的通知。否则状态将保持“重试”。