douyu2817 2013-07-15 07:09
浏览 177
已采纳

为什么我从SagePay收到错误“4020:从无效IP地址收到的信息。”?

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

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

4020 : Information received from an Invalid IP address.

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.

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.

  • 写回答

4条回答 默认 最新

  • doqw89029 2013-07-16 11:03
    关注

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

    • You can use Form/Server/Direct integration interchangeably on the same vendor's account, without needing to change settings or register anything
    • The 4020 error genuinely is an IP restriction error and is not masquerading another error

    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.

    Update

    You can use:

    curl icanhazip.com
    

    Like so:

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

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)