<tfoot id='H0HVR'></tfoot>

    <small id='H0HVR'></small><noframes id='H0HVR'>

  1. <i id='H0HVR'><tr id='H0HVR'><dt id='H0HVR'><q id='H0HVR'><span id='H0HVR'><b id='H0HVR'><form id='H0HVR'><ins id='H0HVR'></ins><ul id='H0HVR'></ul><sub id='H0HVR'></sub></form><legend id='H0HVR'></legend><bdo id='H0HVR'><pre id='H0HVR'><center id='H0HVR'></center></pre></bdo></b><th id='H0HVR'></th></span></q></dt></tr></i><div id='H0HVR'><tfoot id='H0HVR'></tfoot><dl id='H0HVR'><fieldset id='H0HVR'></fieldset></dl></div>

    1. <legend id='H0HVR'><style id='H0HVR'><dir id='H0HVR'><q id='H0HVR'></q></dir></style></legend>
      • <bdo id='H0HVR'></bdo><ul id='H0HVR'></ul>

      Paypal IPN 获得空白确认(应为“已验证"或“无效")

      时间:2023-06-23
    2. <tfoot id='Gfo8C'></tfoot>

        <legend id='Gfo8C'><style id='Gfo8C'><dir id='Gfo8C'><q id='Gfo8C'></q></dir></style></legend>
            <bdo id='Gfo8C'></bdo><ul id='Gfo8C'></ul>
            • <small id='Gfo8C'></small><noframes id='Gfo8C'>

                <tbody id='Gfo8C'></tbody>
            • <i id='Gfo8C'><tr id='Gfo8C'><dt id='Gfo8C'><q id='Gfo8C'><span id='Gfo8C'><b id='Gfo8C'><form id='Gfo8C'><ins id='Gfo8C'></ins><ul id='Gfo8C'></ul><sub id='Gfo8C'></sub></form><legend id='Gfo8C'></legend><bdo id='Gfo8C'><pre id='Gfo8C'><center id='Gfo8C'></center></pre></bdo></b><th id='Gfo8C'></th></span></q></dt></tr></i><div id='Gfo8C'><tfoot id='Gfo8C'></tfoot><dl id='Gfo8C'><fieldset id='Gfo8C'></fieldset></dl></div>

                本文介绍了Paypal IPN 获得空白确认(应为“已验证"或“无效")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我只是在这里测试 Paypal IPN.我已经用 Sandbox 设置好了.我正在向它发送虚假的 IPN 请求,它正在接收 IPN.然后,我让它返回信息以进行验证,并将响应写入文本文件,以便我可以自己检查.IPN 运行良好,响应正在写入文本文件.

                I'm just testing the Paypal IPN here. I've got it set up with Sandbox. I'm sending it fake IPN requests, and it's receiving the IPN. Then, I'm getting it to return the information for verification, and I'm writing the response to a text file so I can check it out on my own. The IPN is firing fine, and the response is getting written to the text file.

                只有一个问题...回复是空白的.

                There's just one problem... The response is blank.

                响应应该被接收为已验证"或无效",而这些是仅有的 2 个可能的响应......所以发生了什么 =S.非常感谢任何帮助.

                The response is supposed to be received as "VERIFIED" or "INVALID", and these are the only 2 possible responses... so what's going on =S. Any help is greatly appreciated.

                完整代码如下:

                $ipn_post_data = $_POST;
                
                $response = "";
                
                    // Choose url
                    $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
                
                    // Set up request to PayPal
                    $request = curl_init();
                    curl_setopt_array($request, array
                    (
                        CURLOPT_URL => $url,
                        CURLOPT_POST => TRUE,
                        CURLOPT_POSTFIELDS => http_build_query(array('cmd' => '_notify-validate') + $ipn_post_data),
                        CURLOPT_RETURNTRANSFER => TRUE,
                        CURLOPT_HEADER => FALSE,
                        CURLOPT_SSL_VERIFYPEER => TRUE,
                        CURLOPT_CAINFO => 'cacert.pem',
                    ));
                
                    // Execute request and get response and status code
                    $response = curl_exec($request);
                    $status   = curl_getinfo($request, CURLINFO_HTTP_CODE);
                
                    // Close connection
                    curl_close($request);
                
                
                $fh = fopen( "ipntest.txt", 'a+' );
                $date = date( "Y-M-j H:i" );
                fwrite( $fh, $date . " Response: " . $response . "
                " );
                fclose( $fh );
                
                if($status == 200 && $response == 'VERIFIED')
                {
                    // All good! Proceed...
                }
                else
                {
                    // Not good. Ignore, or log for investigation...
                }
                

                文本文件输出:

                2012-Nov-26 23:24 Response: 
                2012-Nov-26 23:25 Response: 
                

                我之前一直在使用这个代码,我一直在努力让它工作一个星期,所以这不仅仅是暂时的失败或其他什么......

                I had been using this code previously, I've been trying to get it to work for a week, so it's not just a temporary failure or something...

                伙计们干杯.

                推荐答案

                所以仅供将来参考,对于有同样问题的人:

                So just for future reference, for people with this same problem:

                这里的问题是没有 CA 文件.

                我不确定 CA 文件究竟是做什么的,但我知道它与 Paypal 的 SSL 证书和建立 SSL 连接有关.当我开始查看 cURL 的错误时,我看到了以下内容:

                I'm unsure what exactly a CA file does but I know it has something to do with Paypal's SSL certificate and establishing an SSL connection. When I started looking at cURL's errors, I saw the following:

                [27-Nov-2012 21:46:11 UTC] cURL error: [77] error setting certificate verify locations:
                  CAfile: /etc/ssl/certs/api_cert_chain.crt
                  CApath: /etc/ssl/certs
                

                我找到的快速解决方案是下载 IpnListener.php 类.(这是 eldblz 推荐的.它使处理 IPN 变得更容易,并且为我没有 CAFile 提供了解决方案.如果您下载整个 IpnListener.php 包,它包含一个名为 cert 的文件夹,其中包含您需要的 api_cert_chain.crt,并且已经对其进行了配置以供使用.

                The quick solution that I found was to download the IpnListener.php class. (This was recommended by eldblz. It made dealing with IPN way easier AND it provided a solution to my not having a CAFile. If you download the entire IpnListener.php package, it includes a folder called cert which includes the api_cert_chain.crt that you need, and already has it configured for use.

                这篇关于Paypal IPN 获得空白确认(应为“已验证"或“无效")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Paypal Checkout 客户端集成对于浏览器是否安全? 下一篇:为什么我的 PHP 会话会死掉?为什么我不能恢复它们?

                相关文章

              1. <small id='KUNmg'></small><noframes id='KUNmg'>

                  <tfoot id='KUNmg'></tfoot>
                    <bdo id='KUNmg'></bdo><ul id='KUNmg'></ul>
                  <i id='KUNmg'><tr id='KUNmg'><dt id='KUNmg'><q id='KUNmg'><span id='KUNmg'><b id='KUNmg'><form id='KUNmg'><ins id='KUNmg'></ins><ul id='KUNmg'></ul><sub id='KUNmg'></sub></form><legend id='KUNmg'></legend><bdo id='KUNmg'><pre id='KUNmg'><center id='KUNmg'></center></pre></bdo></b><th id='KUNmg'></th></span></q></dt></tr></i><div id='KUNmg'><tfoot id='KUNmg'></tfoot><dl id='KUNmg'><fieldset id='KUNmg'></fieldset></dl></div>

                  <legend id='KUNmg'><style id='KUNmg'><dir id='KUNmg'><q id='KUNmg'></q></dir></style></legend>