PayPal从IPN端点删除了QueryString值 [英] QueryString values removed from the IPN endpoint by PayPal

查看:65
本文介绍了PayPal从IPN端点删除了QueryString值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们与PayPal进行了简单的付款集成已有5年了,直到今天一直没有问题.在IPN URL(notify_url)中,我们在查询字符串中传递3个值,例如

We've had a simple payment integration with PayPal for 5 years that has run without issue until today. In the IPN URL (notify_url) we pass 3 values in the querystring e.g.

https://www.example.com/callback/ipn?pspId=A&secCode=MnBP%2fxOwbQhXLd%2arD5xd6g%3d%3d&isPur=false

从今天开始,PayPal剥离最后2个值,并仅使用第一个查询字符串值进行调用,例如

From today PayPal strip the last 2 values and call with just the first querystring value, e.g.

https://www.example.com/callback/ipn?pspId=A

我们使用secCode值作为签名,我们在回调中对其进行了验证,以防止对该表单进行任何修改.为什么PayPal突然开始从查询字符串中剥离值?我怀疑它们应该在POST中,但我不确定为什么会突然更改?

We use the secCode value as a signature that we verify on the callback to prevent any modification of the form. Why would PayPal suddenly start stripping out values from the querystring? I suspect they should be in the POST but I'm just not sure why the sudden change?

推荐答案

好,我们现在已经意识到,PayPal服务器的 some 终止于第一个&"号.这就解释了为什么我们得到第一个查询字符串值而不是其他查询字符串的原因.

OK we have now realised that some of PayPal's servers are terminating at the first ampersand. This explains why we get the first query string value but not others.

似乎这种行为不仅限于notify_url值,而且正如Mike在评论中建议的那样,这也在CUSTOM字段中发生.如果要使用与"号分隔符来处理一系列名称值对,则需要切换到其他分隔符或对整个值进行URL编码.

It seems this behaviour is not just limited to notify_url value but as is suggested by Mike in the comments, this is happening with the CUSTOM field too. If you're pushing through a series of name value pairs with an ampersand separator you need to either switch to some other separator or URL Encode the whole value.

我们现在正在测试,看看是否对整个回调URL进行URL编码仍然会导致实际的回调.

We're just now testing to see if URL Encoding the whole callback URL will still result in an actual callback being made.

是的,对整个notify_url值进行编码的URL解决了该问题并保留了查询字符串.

Yes URL encoding the whole notify_url value resolved the issue and preserved the query string.

似乎URL编码的整个值不再起作用,因此我假设在遇到这些问题之前,PayPal已恢复为原始行为.希望这将在所有入站服务器上保持一致,并且现在将保持不变.

It seems URL encoding the whole value no longer works, so I'm assuming PayPal have reverted back to the original behaviour before we encountered these problems. Hopefully this will be consistent across all their inbound servers and will remain fixed now.

这篇关于PayPal从IPN端点删除了QueryString值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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