-2

我已经通过贝宝自适应支付进行了支付,并且成功了

然后我发送验证请求,我得到了 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 但贝宝仍然显示 HTTP 状态代码:500

并且通知网址:http ://example.com/instant_payment_notifications/process_new 不返回 HTTP 状态代码:500

谢谢。

4

1 回答 1

2

仔细查看您的 PayPal 屏幕截图:您的服务器在这些请求上返回 HTTP 代码 500,这意味着 PayPal 将此解释为一件坏事,并且 HTTP 事务没有成功完成,它将再次尝试,直到收到 200 OK。

检查服务器的配置。您最近是否对服务器的配置进行了更改?如果您制作自己的 POST 到您的端点 URL,它是否会为您返回 500 状态代码?在提出这些请求时,它是否已经停止维护了一段时间?设置一些 API 监控以确保不会经常抛出这 500 个错误。

于 2014-06-27T13:11:33.350 回答