简体   繁体   English

Paypal IPN没有调用问题

[英]Paypal IPN not calling Issue

I am having some problem regarding Paypal IPN not getting fired on one of my server. 我有一些问题,关于Paypal IPN没有被我的一个服务器解雇。 Below is the scenario. 以下是场景。

1) I have two sites site A(old) is on server X and site B(new) on server Y.Both the sites having identical Paypal express checkout form submission and IPN code. 1)我有两个站点站点A(旧)在服务器X上,站点B(新)在服务器Y上。具有相同Paypal快递结账表单提交和IPN代码的站点。 2) Site A is running smoothly with paypal express checkout form submission and IPN is get fired correctly. 2)网站A运行顺利,PayPal快速结账表单提交,IPN被正确解雇。 3) But with Site B, though our form gets submitted correctly and payment is successful, IPN is not getting fired. 3)但是对于站点B,虽然我们的表单已正确提交并且付款成功,但IPN并未被解雇。

More information : I checked Paypal`s business A/c for any of functionality that may needed to add IP/domain where IPN is located. 更多信息:我检查了Paypal的业务A / c,了解添加IPN所在IP /域所需的任何功能。

I have also checked with Paypal support where they says that from 25 March 2014 they have told to add Paypal`s API related IP address to our servers firewalls. 我还检查了Paypal支持他们说从2014年3月25日起他们已经告诉我们将Paypal的API相关IP地址添加到我们的服务器防火墙。 We had done with adding those IP address but still this is not working. 我们已经完成了添加这些IP地址,但仍然无法正常工作。

  URL : https://ppmts.custhelp.com/app/answers/detail/a_id/14/related/1/session/L2F2LzEvdGltZS8xNDAxMTcyODkwL3NpZC9VbENEUWhWbA%3D%3D

Hope following information is sufficient for you. 希望以下信息对您而言足够。 Please suggest if any one of us have some solution to overcome. 如果我们中的任何一个人有解决方案,请建议。

Thanks in advance. 提前致谢。

Unfortunately, there's not much issue specific information for me to work with, so lets make this an IPN Troubleshooting Guide for future reference :) 不幸的是,我没有太多特定信息可供使用,所以让我们将其作为IPN故障排除指南以供将来参考:)

Check the IPN feature status for the given account - 检查给定帐户的IPN功能状态 -

https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-ipn-notify (login to your account first, then follow the link to be taken to the IPN Settings) https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-ipn-notify (首先登录您的帐户,然后按照链接进入IPN设置)

Alternative: 替代方案:

  • Login to PayPal.com 登录PayPal.com
  • Open Profile --> My Selling Preferences 打开个人资料 - >我的销售偏好
  • Find the "Instant payment notifications" option 找到“即时付款通知”选项

There are four states IPN can be in: IPN有四种状态:

  • Enabled --> If you're prompted to choose your settings, IPN is enabled and IPNs will be sent if a notify URL is passed in the checkout request. 已启用 - >如果系统提示您选择设置,则会启用IPN,并且如果在结帐请求中传递了通知URL,则会发送IPN。

  • Enabled with Default URL Set --> If a "Notification URL" is displayed and "Message delivery" is set to enabled, the default URL will be used every time you do not specify a different IPN URL in the checkout request (eg eBay transactions will be sent to the default URL because eBay's Express Checkout Integration does not pass a notify URL) 使用默认URL集启用 - >如果显示“通知URL”并且“邮件传递”设置为启用,则每次在结帐请求中未指定其他IPN URL时将使用默认URL(例如,eBay事务将被发送到默认URL,因为eBay的Express Checkout Integration不会传递通知URL)

  • Disabled --> You never set the default URL, but IPN URL passed in your transactions has been throwing too many errors. 已禁用 - >您从未设置默认URL,但在事务中传递的IPN URL已经抛出了太多错误。 You should see the empty Address field and the option "Do not receive IPN messages (Disabled)" being checked. 您应该看到空的地址字段和选中“不接收IPN消息(已禁用)”选项。

  • Disabled with Default URL Set --> a default IPN URL was configured at some point in time, but due to failures on the default URL or on the dynamic URLs, the IPN feature has been disabled. 已禁用默认URL集 - >在某个时间点配置了默认IPN URL,但由于默认URL或动态URL上的故障,IPN功能已被禁用。 You will see the URL and "Message Delivery = Disabled" 您将看到URL和“Message Delivery = Disabled”

Why does PayPal disable IPN delivery? 为什么PayPal会禁用IPN传送?

PayPal expects your server to respond with a HTTP-200 OK message. PayPal希望您的服务器使用HTTP-200 OK消息进行响应。 If we receive a different response code, a retry mechanism is set in motion. 如果我们收到不同的响应代码,则会启动重试机制。 The IPN message is sent a total of 16 times with increasing time frames between each attempt. IPN消息总共发送16次,每次尝试之间的时间帧增加。 If the errors for one URL reach a certain threshold, IPN is disabled automatically. 如果一个URL的错误达到某个阈值,则会自动禁用IPN。 You will receive an e-mail message to the main e-mail address listed on the PayPal Account, that warns you of an impending deactivation 您将收到PayPal帐户中列出的主要电子邮件地址的电子邮件,警告您即将停用

  1. If IPN is enabled, check the status of the last IPN messages under https://www.paypal.com/cgi-bin/webscr?cmd=%5fdisplay%2dipns%2dhistory&nav=0%2e3%2e4 如果启用了IPN,请检查https://www.paypal.com/cgi-bin/webscr?cmd=%5fdisplay%2dipns%2dhistory&nav=0%2e3%2e4下最后一条IPN消息的状态

    It'll show you the last HTTP Response Codes your server is sending back and you can filter for failed / retrying messages. 它将显示服务器发送回的最后一个HTTP响应代码,您可以过滤失败/重试消息。

    Check http://en.wikipedia.org/wiki/List_of_HTTP_status_codes to see what the status means. 查看http://en.wikipedia.org/wiki/List_of_HTTP_status_codes以查看状态的含义。

  2. If there is not HTTP Response code, there's a connection issue on a lower level. 如果没有HTTP响应代码,则在较低级别存在连接问题。 Most frequently caused by: 最常见的原因是:

    • Firewalls 防火墙
    • SSL Connectivity Problems (try using HTTP) SSL连接问题(尝试使用HTTP)
    • Black Hole Routing 黑洞布线

    If you feel that everything is configured correctly, check out https://ppmts.custhelp.com/app/answers/detail/a_id/733 如果您认为所有内容都配置正确,请查看https://ppmts.custhelp.com/app/answers/detail/a_id/733

  3. If the IPN messages are marked as "SENT" (HTTP 200 Received), the next step in IPN processing is posting the data back to PayPal for validation. 如果IPN消息被标记为“SENT”(HTTP 200已接收),则IPN处理的下一步是将数据发布回PayPal以进行验证。 You can either enable logging within the script (dump the HTTP request and response in a file on the server) - or you can contact PayPal MTS ( https://www.paypal.com/mts ) and ask what's visible on the PayPal Side. 您可以在脚本中启用日志记录(将HTTP请求和响应转储到服务器上的文件中) - 或者您可以联系PayPal MTS( https://www.paypal.com/mts )并询问PayPal端可见的内容。

    A good test to check the connectivity to paypal is to run the following command on the webserver itself: 检查与paypal连接的一个很好的测试是在Web服务器本身上运行以下命令:

    curl -d "cmd=_notify-validate" -v https://www.paypal.com/cgi-bin/webscr curl -d“cmd = _notify-validate”-v https://www.paypal.com/cgi-bin/webscr

  4. If you see that the POST has reached PayPal, but PayPal responds with INVALID for all messages: 如果您发现POST已到达PayPal,但PayPal会针对所有消息以INVALID响应:

    Check your code, https://github.com/paypal/ipn-code-samples is a good source of samples 检查您的代码, https://github.com/paypal/ipn-code-samples是一个很好的样本来源

  5. If PayPal responds with INVALID to some messages, you're likely running into an encoding issue. 如果PayPal以某些消息的INVALID响应,您可能会遇到编码问题。 You'd best set your Character Encoding settings under https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-language-encoding - set them to UTF8 for the best results. 您最好在https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-language-encoding下设置您的角色编码设置 - 将它们设置为UTF8以获得最佳效果。

  6. If PayPal Responds with VERIFIED, but your script doesn't continue processing after validating the payment, make sure you run a TRIM() (or the equivalents in the language being used) to remove whitespace, line feeds and CRLF 如果PayPal以VERIFIED响应,但您的脚本在验证付款后未继续处理,请确保运行TRIM()(或使用的语言中的等效项)以删除空格,换行符和CRLF

  7. What happens afterwards is up to the IPN script you may run into errors while connecting to a database, parsing the IPN message for certain data or some coding errors. 之后发生的事情取决于IPN脚本,您在连接到数据库时可能会遇到错误,解析IPN消息中的某些数据或某些编码错误。

In short: If the IPN message has been received, posted back and verified, everything else happens in your own code on your server and you'd have to start digging through log files (or make sure logs are being created, that's always a good idea) to find out what's going on. 简而言之:如果收到IPN消息,回发并验证,其他所有内容都发生在您服务器上自己的代码中,您必须开始挖掘日志文件(或确保创建日志,这总是很好的想法)找出发生了什么。 If the problem is reproducible, it is always a good idea to check what happens with one of the sample scripts (which include logging) 如果问题是可重现的,那么检查其中一个示例脚本(包括日志记录)会发生什么事情总是一个好主意

Hope this helps tackling IPN issues head on - any questions regarding IPN? 希望这有助于解决IPN问题 - 任何有关IPN的问题? Contact paypal.com/mts if you want to investigate what's happening on the paypal side. 如果您想调查PayPal侧发生的事情,请联系paypal.com/mts。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM