Fix Sage 50 Pay Error 4020

By Antonio Garcia May 21, 2024 8 min

Sage Pay error 4020 typically occurs when your web server’s IP address is missing or incorrectly configured in the Opayo/Sage Pay Administrative Site. Call at +1-844-341-4437 for immediate and live Sage assistance. When this registration mismatch happens, the application causes an error message and blocks transactions. While a missing IP address is the primary reason, several other configuration mismatches can cause this problem.
This guide breaks down the hidden factors behind Sage 50 Pay error 4020 and provides the best troubleshooting solutions to get your Payment gateway back online quickly.

What Is Sage Pay Error 4020 Invalid IP Address?

Sage Pay error 4020 occurs when the software detects an invalid IP address for transactions. Users receive an error message, stating “Error 4020: Information received from an Invalid IP address”.
This security mismatch between your system and Sage Pay (which is now Opayo). It immediately halts your Payment processing and causes performance lags. Resolving this issue requires updating your server’s IP address within your administrative settings to get transactions flowing smoothly again.

What Causes Sage Pay Error Code 4020 Invalid IP Address?

Sage Pay error code 4020 indicates that the information was received from an invalid IP address. It occurs when your website attempts to process a transaction or callback, but the outbound IP address of your web server is not registered in your Payment gateway account.

  • Unregistered Web Server IP

The IP address your server uses to communicate with Sage Pay has not been added to your Valid IP list. As a result, it brings Sage Pay error 4020 invalid IP address message.

  • Shared Server/Multiple IPs

If you are on shared hosting, your site might be using a different outbound IP address than your main domain, or it may rotate through a pool of IPs.

  • Hosting Migration Or Changes

Moving your website to a new host, changing servers, or upgrading hosting plans changes your server’s IP address, breaking the previous connection.

  • Incorrect Protocol Integration

Using the wrong endpoint or failing to update server-to-server POST configurations when changing accounts or sub-domains.

How To Troubleshoot Sage Pay (Opayo) Error 4020?

Here is a step-by-step solution guide to troubleshooting and resolving Sage Pay (Opayo) error 4020:

Solution 1 – Verify The Accurate Sage Pay IP Address
One of the most common reasons for facing Sage 50 error 4020 is when your web server’s IP address is not added to Sage Pay (Opayo) admin site. Follow the prompts below to verify the correct IP address:

  • First of all, log in to your Sage Pay Stimulator account, and then visit the Magento admin site.
  • From here, choose System, and then click Configuration. After this, select the Sales option.
  • Now, access Sage Pay and choose Sage Pay Suite. Next, enter the Stimulator vendor in the Vendor field.
  • After this, specify the Stimulator mode in Sage Pay matching set configuration. Here, choose either Sage Pay Suite (Direct Integration) or Sage Pay Suite (Server Integration).
  • Once done, save the settings and refresh the cache.
  • Finally, verify the resolved Sage 50 error 4020. If you still face the same issue, try another method.

Solution 2 – Add The Missing/Correct IP Address To Your Sage Pay Control Panel

A missing or incorrect IP address causes the error code 4020 in Sage Pay. We suggest that you add the approved IP address to your Sage Pay Control Panel.

  • Firstly, try to send the transaction. If you encounter the error message 4020 invalid IP address, open the Control Panel.
  • Next, type your Sage Pay domain or site URL.
  • Press the Enter key and copy the IP address. Now, log in to the Sage Pay Control Panel.
  • Move to the Manage IP addresses section and add the correct IP address.
  • Now save the changes and retry sending the transaction. If you again see the same Sage Pay error 4020 invalid IP address message, move to the next solution.

Solution 3 – Restore System To The Previous Version
Another effective method to get rid of Sage Pay 4020 error is restoring the system to the previous version. This approach can prevent issues between Sage 50 Pay and IP address configuration. Here are the steps to focus on:

  • Begin by first logging in to your computer. Make sure you run as an administrator.
  • After this, go to the All Programs, and click All Accessories.
  • From here, choose System Tools and then click System Restore.
  • Now, search for the Restore My System to an Earlier Time option.
  • Choose the Next option, and it will directly initiate the system restoration.
  • Wait till the restoration gets completed. Once it’s done, restart your computer system.

Solution 4 – Temporarily Turn Off Your Windows Firewall/Antivirus

Your Windows Firewall/Antivirus can prevent Safe Pay from accessing the internet, which may result in Sage Pay error code 4020. To address this problem, disable the Firewall, add Sage 50 Pay as an exception in the program, and then try sending transactions.

  • Press the Windows key, type Control Panel within the Search bar, and then choose the Enter key.
  • Choose the System and Security tab and select Windows Defender Firewall.
  • In the left-hand menu, click Turn Windows Defender Firewall on or off.
  • Select Turn off Windows Defender Firewall (not recommended) for both Private and Public network settings.
  • Click OK, and visit the main Windows Defender Firewall screen in the Control Panel.
  • From the left-hand menu, choose Allow an app or feature through Windows Defender Firewall.
  • Now, click the Change settings option at the top right. If asked for Administrator permissions, run as administrator.
  • Next, choose the Allow another app option. From the pop-up window, click Browse and move to your Sage 50 installation folder, which is typically C:\Program Files (x86)\Sage\Accounts\ or C:\Program Files\Sage 50.
  • Look for the main executable file, which is usually Sage.Accounting.exe or Alchemex.NET.exe, depending on your version. Select it, then click Open.
  • Click Add and ensure both the Private and Public checkboxes next to Sage 50 are ticked in the allowed apps list.
  • Finally, choose OK.

Note – Never leave your Firewall permanently disabled. Now that the exception is made, turn your security back on.

  • On the left menu, click Turn Windows Defender Firewall on or off.
  • Switch both Private and Public network settings back to Turn on Windows Defender Firewall, and click OK.

Solution 5 – Configure Network Ports
Sage 50 and the payment gateway require specific network ports to be wide open for outbound traffic. If your router or network switch blocks these, transactions will fail, and you will receive the Sage error 4020 message.
Ensure your network router/hardware firewall allows Outbound traffic on the following ports:

  • Port 443 (HTTPS): This is the main port, which is used for secure Opayo transaction traffic.
  • Port 80 (HTTP):This one is for standard web communications and certificate validation.
  • Ports 5143, 5144, and 5145: These ports are specifically used by Sage 50 for data routing and internal messaging.

Solution 6 – Enable TLS 1.2 And TLS 1.3 Security Protocols
Sage Pay requires secure TLS connections. If your Windows internet settings are using outdated security protocols, the connection will be blocked. This problem can also cause Sage error 4020, so fix it with the steps below:

  1. Simultaneously press Windows Key + R to open the Run dialog box.
  2. Type inetcpl.cpl and press Enter. It will open your Internet Properties.
  3. Now, click the Advanced tab and scroll down to the bottom of the Settings list to find the Security section.
  4. Ensure the following checkboxes are checked:
    • [x] Use TLS 1.2
    • [x] Use TLS 1.3
  5. Ensure Use SSL 3.0, Use TLS 1.0, and Use TLS 1.1 are unchecked (as these are deprecated and insecure).
  6. Lastly, click Apply, then choose OK.

Solution 7 – Add Sage Pay (Opayo) Domains To Your Network/Proxy

If your business uses a proxy server or an internet filter, it may be blocking the URLs Sage 50 uses to connect to the payment gateway. You need to add these URLs to your trusted sites.

  1. Open the Internet Properties window (Windows Key + R) and type inetcpl.cpl.
  2. Now, click the Security tab, and select the green check-mark icon labelled Trusted sites, then click the Sites button.
  3. In the Add this website to the zone field, enter the following addresses one by one, and select the Add button after each:
    • https://*.sagepay.com
    • https://*.opayo.co.uk
    • https://*.sage.com
  4. Once done, click Close, then choose Apply.

Sage Pay error 4020 can disrupt your business operations. However, by ensuring your server’s static outgoing IP address is correct and connected with the portal, turning off your Windows Firewall, and correcting the network settings, you can easily restore seamless transaction processing. Hopefully, this troubleshooting guide has helped you get rid of Sage Pay (Opayo) error 4020. You can also dial +1-844-341-4437 to get instant live assistance.
Also Read:
How To Fix Sage 50 Error 3032?

About The Author

Antonio Garcia

Antonio Garcia

Antonio Garcia writes for Sage Online Solution and helps businesses manage their financial books more effectively. He offers practical advice and solutions that simplify accounting software use, so companies handle their finances with ease and accuracy. With years of experience, Antonio understands what businesses need to succeed. He aims to make accounting less stressful for everyone.