我已经在 VBScript/Classic ASP 中实现了一个 IPN 监听器。
在我看来,它似乎工作得很好。
当它被调用时,它会将消息发送回 Paypal 并附加 cmd=_notify-validate
。然后检查 objHttp.status = 200
和 objHttp.responseText = "VERIFIED"
的响应,然后将订单添加到我的数据库中。
但是 Paypal 正在向我发送电子邮件;
Subject: PayPal Instant Payment Notification Warning
Instant Payment Notifications sent to the following URL(s) are failing:
最佳答案
根据 IPN Testing
Every listener must include code that handles the "error notification" IPN messages.
无论哪种方式,您都应该按照 IPN troubleshooting tips 中的步骤进行操作一步一步。
以下是我挑选的一些应该有所帮助的内容。
- 检查您的 IPN 历史记录中列出的 URL,以确保 PayPal 将每个 IPN 发布给您的听众。
- 检查网络服务器的访问和错误日志。
- 检查您的编程语言的错误日志。
- 验证您的 IPN 监听器正在响应所有消息,即使是那些您不打算处理的消息。
进一步到 OPs comments
the code samples Paypal give, in which this step isn't performed. Is this step required?
听起来您缺少文档工作流程中的第 2 步
2. After receiving the IPN message from PayPal, your listener returns an empty HTTP 200 response to PayPal. Otherwise, PayPal resends the IPN message.
从 PHP 示例来看,两者似乎都先发送验证,这与文档建议的工作流程不符。
在这种情况下你应该能够做到
Response.Status = "200 OK"
在其余代码之后,确保没有使用 Response.Write()
写回任何其他内容,这样服务器响应为空白,您甚至可以使用
Call Response.Clear()
在设置 Response.Status
之前确保没有从 Response
缓冲区中写入任何其他内容。但是,这仅在 Response.Buffer
事先设置为 True
时才有效(通常在脚本的开头)。
关于 Paypal IPN 处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40866253/