【问题标题】:IPN was not sent, and the handshake was not verified. Please review your informationIPN 未发送,握手未验证。请查看您的信息
【发布时间】:2016-09-27 21:25:07
【问题描述】:

我参考了之前所有关于此的 stackoverflow 答案。但我不清楚如何处理我的案子。

IPN was not sent, and the handshake was not verified. Please review your information.

这是我在使用 ipn 模拟器发送 ipn 消息时遇到的错误..

我正在使用来自

的脚本

https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php

我只是用沙盒帐户检查这个

我没有使用 https 网站。我只使用http。

我试过了

             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',

cacert.pem 包含 https://www.symantec.com/content/dam/symantec/docs/other-resources/verisign-class-3-public-primary-certification-authority-g5-en.pem

即使我将 CURLOPT_SSL_VERIFYPEER 更改为 false 但也没用

我不知道该怎么办,请帮忙

更新:我删除了侦听器页面中的所有内容,只放了 file_put_contents("ipntest.txt", var_export($_POST, true));仍然是相同的错误,并且 ipntest.txt 文件也没有创建 谢谢,

【问题讨论】:

  • 你想发送 IPN 还是检索 IPN?
  • 检查cacert是否有效
  • @KikiTheOne 我都在我的开发服务器中测试它。我正在使用来自developer.paypal.com/developer/ipnSimulator 的 ipn 模拟器发送 ipn 而且我希望在我的开发服务器中进行处理,这只是 http
  • 用于检索检查下面的答案。我删除了它,因为我之前有 1 个问题:D PayPal 发送给你的内容很简单 $_POST。

标签: php paypal


【解决方案1】:

截至目前(2017 年 3 月),IPN 模拟器似乎根本无法运行。使用沙盒账户启动正常的支付周期;它确实有效。

【讨论】:

  • 呃,这解释了很多!
  • 我不确定。我在 2017 年 3 月 5 日开始使用沙盒付款,但自 2017 年 3 月 10 日起,它不再起作用。尝试 IPN 我收到此错误。
  • 昨天在调试我的监听器 - 沙盒对我有用,尽管有时它需要几个小时甚至几天才能发送确认。 (有时手动重新发送它们会有所帮助)。模拟器,不,它甚至没有连接到监听器。
【解决方案2】:

PayPal Sandbox 已升级,仅接受与 TLSv1.2 的 SSL 连接(不接受 TLS 1.1 及更低版本的 SSL)。您需要确保您的 apacha / OpenSSL 支持 tlsv1.2,请在终端上运行命令并验证:

$ openssl s_client -connect api-3t.sandbox.paypal.com:443 

通常将您的 OpenSSL 升级到 1.0.1 或更高版本即可。

【讨论】:

  • 我运行它在最后一行显示的代码验证返回代码:0(正常)。我的网站应该用 https 升级吗?我不能使用 curl 来执行此操作吗?
  • 我遇到了同样的错误,令人困惑的是服务器已经托管了另外两个使用 PayPal 正常工作的站点,命令行检查返回“验证返回代码:0 ( ok)”,并声明它使用的是 TLS 1.2。
【解决方案3】:

你应该使用 te PayPal IPN 模拟器。 https://developer.paypal.com/developer/ipnSimulator/

PayPal IPN 无需 CURL。

PayPal 向定义的地址发送基本 $_POST。所以你只需要使用$_POST['payment_type']

有时你需要header('HTTP/1.1 200 OK');

在我的情况下,测试中的 $_POST 如下所示。

$._POST:{payment_type=instant&payment_date=Mon+May+30+2016+08%3A47%3A06+GMT+0200+%28Mitteleurop%E4ische+Sommerzeit%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=Scriptkiddie&last_name=StackOverflow&payer_email=buyer%40paypalsandbox.com&payer_id=TESTBUYERID01&address_name=John+Smith&address_country=United+States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San+Jose&address_street=123+any+street&business=seller%40paypalsandbox.com&receiver_email=seller%40paypalsandbox.com&receiver_id=seller%40paypalsandbox.com&residence_country=US&item_name=something&item_number=AK-1234&quantity=1&shipping=3.04&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&txn_type=web_accept&txn_id=136666829&notify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AnKUojs05l5xK--wKubHCkCuzwmCAxnK4WCLxW3c2aUgJNx4ufcY8RSh}

【讨论】:

    猜你喜欢
    • 2015-12-11
    • 2016-01-27
    • 2017-01-04
    • 2018-05-12
    • 2016-02-11
    • 2017-01-10
    • 2016-03-05
    • 2016-05-27
    • 2017-02-17
    相关资源
    最近更新 更多