This question already has answers here:
IPN was not sent, and the handshake was not verified. Please review your information.
                                
                                    (2个答案)
                                
                        
                                4年前关闭。
            
                    
经过大量搜索和搜索后,为了使wamp安装启用https(自签名证书)[我遵循本指南click here]
我还激活了具有域名的dyn-dns免费服务。
但是,每当我尝试测试ipn模拟器时,总是会收到相同的消息。
另外,如果我测试在线网站IPN,则无法发送请求。

有签名证书是强制性的吗?
ipn可接受的URL格式是什么?
目前正在运作吗?
此错误消息的原因是什么?

最佳答案

试一下:

$req = 'cmd=_notify-validate';

foreach($_POST as $key => $value) {
    $value = urlencode($value);
    $req .= "&{$key}={$value}";
}

$res = '';
$ch = curl_init(paypal_url());
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, 0);//Should be 1 if you want to verify peer
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);//Should be 2 if you want to verify host
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
$res = curl_exec($ch);
curl_close($ch);


    $fname = 'ipn_intial_' . date('Y.m.d-h.i.s', time()) . '.txt';
    file_put_contents('log/' . $fname, $req);

    $fname = 'ipn_intial_result_' . date('Y.m.d-h.i.s', time()) . '.txt';
    file_put_contents('log/' . $fname, $res);

if(strcmp($res, "VERIFIED") == 0)
{
    ....
}


如果贝宝请求甚至没有发送到您的服务器,则可能是防火墙问题。

关于php - Paypal IPN未发送,握手未验证。请查看您的信息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33963276/

10-13 04:15