为什么我收到错误“4020:从无效 IP 地址收到的信息".来自 SagePay? [英] Why am I getting the error "4020 : Information received from an Invalid IP address." from SagePay?

查看:26
本文介绍了为什么我收到错误“4020:从无效 IP 地址收到的信息".来自 SagePay?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个 PHP (Zend Framework 1.11) 站点,不使用现成的软件包.当请求:

This is a PHP (Zend Framework 1.11) site, not using an off-the-shelf package. When the request to:

https://live.sagepay.com/gateway/service/vspserver-register.vsp

(使用 PAYMENTTxType),我得到以下响应:

(with a TxType of PAYMENT), I get the following response:

4020 : Information received from an Invalid IP address.

我已登录到 SagePay 管理区域并将实时服务器的 IP 地址添加到有效 IP 部分,并且我已确保它使用正确的 SagePay URL 发布到和.

I have logged in to the SagePay admin area and added the IP address of the live server to the Valid IPs section and I've made sure it's using the correct SagePay URL to post to and.

一个重要的注意事项是这个问题是从今天早上开始的,当时我们通过更改 Vendor 属性更改了发送付款的 SagePay 帐户.

An important note is that this issue started this morning, when we changed the SagePay account that payments get sent to, by changing the Vendor attribute.

更新:这个相同的帐户(供应商)用于其他使用表单集成方法的帐户,但有问题的站点使用服务器集成方法.个人账户是否可以支持多种不同的支付方式,或者是否需要激活另一种?我在管理面板中没有看到任何与此相关的选项.

Update: This same account (vendor) is used on other accounts with the Form integration method, but the site in question used the Server integration method. Can individual accounts support multiple different payment methods like this, or does one need to activate the other? I don't see any options relating to this in the admin panel.

推荐答案

在收到 SagePay 的回复后,我发现了以下重要说明:

After getting a response from SagePay I have found the following important notes:

  • 您可以在同一供应商的帐户上交替使用 Form/Server/Direct 集成,而无需更改设置或注册任何内容
  • 4020 错误确实是 IP 限制错误,并没有伪装成另一个错误

这里的问题是网络服务器 (www.mysite.com) 的 IP 地址在 VPS 上,结果 不是curl 请求.我制作了一个测试 PHP 页面,该页面将 $_SERVER['REMOTE_ADDR'] 中的 IP 邮寄给自己,并将其放在另一台服务器上.然后我使用 curl 来抓取那个脚本,然后发现它是一个不同的 IP.将此(零填充版本)放入我的 SagePay 控制面板(使用管理员帐户登录)中的 Valid IPs 部分,它立即栩栩如生.

The issue here was that the IP address of the web server (www.mysite.com), being on a VPS, turned out to not be the same address as the one used when curl requests were made. I made a test PHP page that mailed the IP in $_SERVER['REMOTE_ADDR'] to myself and put it on another server. I then used curl to grab that script and low and behold it was a different IP. Putting (a zero padded version of) this in to the Valid IPs section in My SagePay control panel (logged in with the admin account) it sprung to life immediately.

您可以使用:

curl icanhazip.com

像这样:

[user@host ~]# curl icanhazip.com
177.12.41.200

从您托管网站的服务器的命令行显示要使用的正确 IP,而不是上传文件和所有这些恶意软件.更多信息和用法在这里.

to display the correct IP to use, from the command line of the server you're hosting the web site on, instead of uploading files and all that malarkey. More information and usage here.

这篇关于为什么我收到错误“4020:从无效 IP 地址收到的信息".来自 SagePay?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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