简体   繁体   English

Paypal IPN连续点击同一笔交易即可到达我的IPN页面

[英]Paypal IPN continuously hits my IPN page w/the same transaction

I just moved my server to a new host, and obviously changed the DNS for my paypal ipn page. 我只是将服务器移至新主机,并且显然更改了我的贝宝ipn页面的DNS。

For some reason paypal keeps hitting my page about every 30 seconds with the same transactions over and over again. 出于某种原因,贝宝(Paypal)会每30秒钟重复一次相同的交易,一次又一次地点击我的页面。

So of course its verified then stored in the database as duplicate records. 因此,当然要对其进行验证,然后将其作为重复记录存储在数据库中。

Has anyone had this problem? 有人遇到过这个问题吗? Or know how to fix? 还是知道如何解决?

Make sure that your browser is returning 200 OK status to paypal. 确保您的浏览器向Paypal返回200 OK状态。

Either way, you should store IPN tracking IDs (ipn_track_id) in your database and check for duplicates. 无论哪种方式,都应在数据库中存储IPN跟踪ID(ipn_track_id),并检查是否存在重复。 This is the only guaranteed way to solve your problem. 这是解决问题的唯一保证方式。

According to PayPal's IPN documntation: 根据PayPal的IPN文档:

Your listener must respond to each message, whether or not you intend to do anything with it. 无论您是否打算对其进行任何操作,您的听众都必须对每条消息做出响应。 If you do not respond, PayPal assumes that the message was not received and resends the message. 如果您没有回应,PayPal会假定未收到该邮件,然后重新发送该邮件。 PayPal continues to resend the message periodically until your listener sends the correct message back, although the interval between resent messages increases each time. PayPal会继续定期重新发送消息,直到您的听众将正确的消息发送回为止,尽管每次重新发送消息之间的间隔都会增加。 The message can be resent for up to four days. 该邮件最多可以重发四天。

This resend algorithm can lead to situations in which PayPal resends the IPN message while you are sending back the original message. 此重新发送算法可能导致您在发回原始消息时,贝宝重新发送IPN消息的情况。 In this case, you should send your response again, to cover the possibility that PayPal did not actually receive your response the first time. 在这种情况下,您应该再次发送您的回复,以解决PayPal首次未实际收到您的回复的可能性。 You should also ensure that you do not process the transaction associated with the message twice. 您还应确保不要重复处理与消息关联的事务。

IMPORTANT: PayPal expects to receive a response to an IPN message within 30 seconds. 重要信息:贝宝希望在30秒内收到对IPN消息的响应。 Your listener should not perform time-consuming operations, such as creating a process, before responding to the IPN message. 在响应IPN消息之前,您的侦听器不应执行耗时的操作(例如创建进程)。

So a) is your script properly responding and b) is the notify_url parameter from your transaction different with your DNS change? 那么a)您的脚本是否正确响应,b)交易中的notify_url参数是否与DNS更改不同?

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

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