Paypal IPN通知两次 [英] paypal ipn notification twice

查看:188
本文介绍了Paypal IPN通知两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的通知脚本启动了两次,第一次是VERIFIED,第二次是INVALID.

My notification script is launched twice first is VERIFIED and second INVALID.

我尝试了不同的ipn验证脚本,并且总是得到两次.

I've tried different ipn validation scripts and always get it twice.

我正在使用沙箱,卖家帐户设置可能不正确?我已经将IPN设置为具有通知网址和自动返回功能.同样在表单中,有return和notify_url设置

I'm using sandbox maybe seller account settings are not right? I've set IPN on with notify url and auto return. Also in form there is return and notify_url set

推荐答案

我记得在文档中指出重复是可能的-这只是互联网的本质.这就是为什么它为您提供唯一的交易ID.如果您两次收到通知,则应该使用它来防止发生不良情况.

I remember in the documentation it states that duplicates are possible -- that's just the nature of the internet. That's why it gives you a unique transaction ID. You're supposed to use that to prevent bad things from happening if you get notified twice.

一个更好的问题可能是:为什么它说已验证"然后无效?还是可以吗?

A better question might be: why does it say Verified and then Invalid? Or is that ok?

编辑

文档说:"PayPal发送了一个单个单词返回,如果该消息源自贝宝,则为VERIFIED;如果与原始发送的内容有任何差异,则为INVALID".我会猜测您的代码无意中两次将回声"发送回PayPak,其中之一格式错误.也许它们是相同的,但是PayPal会两次收到INVALID来响应.但是无论如何,对于特定的交易ID,一旦获得验证,就可以了.只需忽略所有后续响应即可.

The docs say "PayPal sends a single word back, which is either VERIFIED if the message originated with PayPal or INVALID if there is any discrepancy with what was originally sent". I'm going to guess that YOUR code accidentally sends the "echo" back to PayPak twice and one of them is malformed. Maybe they're both identical but PayPal responds with INVALID if it gets it twice. But no matter, for a particular transaction Id, once you get VERIFIED, you're good. Simply ignore all subsequent responses.

编辑2

贝宝(PayPal)仅使用返回URL将用户重定向回您的站点.使用此页面感谢他们的购买,并通知他们在处理完成后会收到通知.如果您不需要此功能,甚至可以将其设置为空字符串.付款实际完成(或确定了某些问题)后,PayPal将调用通知URL引用的脚本.在这里,您可以确保一切正常,处理重复的通知,更新数据库,向用户发送电子邮件,说明他们的付款已处理,等等.

The return url is simply used by PayPal to redirect the user back to your site. Use this page to thank them for their purchase and inform them they will be notified once processing is complete. You can even set this to an empty string if you don't want this feature. When Payment is actually complete (or some problem was identified), PayPal will invoke the script referenced by the notify url. This is where you make sure everything looks right, handle duplicate notifications, update your database, send an email to the user saying their payment was processed, etc.

这篇关于Paypal IPN通知两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆