我已经通过贝宝(Paypal)自适应付款进行了付款,并且付款成功
然后我发送验证请求,但我得到status = VERIFIED
这是代码:
function process_new() {
$req = 'cmd=_notify-validate&'.file_get_contents("php://input");
$ipnmsg=$this->decodePayPalIPN($req);
$ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
$res=curl_exec($ch);
curl_close($ch);
//if ($this->InstantPaymentNotification->is_valid($req))
if($res=='VERIFIED') // i got verified here
{
$txnIds=array();
$notifications = $this->InstantPaymentNotification->buildAssociationsFromIPN_new($ipnmsg);
foreach($notifications as $notification){
$this->IpnNotification->create();
$this->IpnNotification->save($notification);
$txnIds[]=$this->IpnNotification->id;
}
//$this->InstantPaymentNotificationNew->saveAll($notification);
$this->__processTransactionNew($txnIds);
}
//$this->redirect('/');
}
无法找到notify_url持续命中的原因。
如果需要更多信息,我也将其发布...
这是IPN历史:
`$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);`
它返回200,但仍然在Paypal上显示HTTP状态代码:500
并且通知网址:http : //example.com/instant_payment_notifications/process_new不返回HTTP状态码:500
谢谢。
仔细查看您的PayPal屏幕截图:您的服务器在这些请求上返回HTTP代码500,这意味着PayPal将其解释为一件坏事,并且HTTP事务未成功完成,它将再次尝试直到收到200 OK。
检查服务器的配置。您最近是否更改了服务器的配置?如果您将自己的POST编写到端点URL,它是否为您返回500状态代码?提出这些请求后,是否已将其关闭进行维护?设置一些API监视以确保不经常抛出这500个错误。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句