<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 获得空白确认(应为“已验证"或“无效")

      Paypal IPN Getting blank confirmation ( should be quot;VERIFIEDquot; or quot;INVALIDquot; )(Paypal IPN 获得空白确认(应为“已验证或“无效))
    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 获得空白确认(应为“已验证"或“无效")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <tbody id='KUNmg'></tbody>

              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>