How do I refund orders in Opayo (formerly SagePay)?

Usually, you would refund orders by logging in to your Opayo account, but with our AG SagePay Opayo (Formerly SagePay) – WooCommerce Gateway plugin, you can process the refunds inside your WooCommerce dashboard.

Here are the steps to do it:

Step 1- Place your Opayo password and Opayo user in our plugin settings.

Navigate from your WordPress dashboard > WooCommerce > Settings > Payments > AG Opayo (Formerly SagePay) Server and Click Manage.

Enter your Opayo password and the Opayo user that you have received from Opayo into the fields below:

Merchants would need to whitelist the IP address for the refund API.
You can proceed in doing it from your Opayo back office >> Settings >> Valid IPs:

Click on add and enter the IP address, enter for the subnet mask and add a description for it, so you know what website the IP address represents.
You can use tools like this website – to find out your site’s server IP address.

Step 2 – Process the refund from your WooCommerce Order dashboard.

Navigate from your WordPress dashboard > WooCommerce > Orders and select the order that you wish to refund.
After selecting the order, you should see the refund button labeled “Refund via AG SagePay.”

Image 2020-04-22 at 6.48.50 PM

Click the said refund button, and it should process the refund without any issues.

A Deeper and Technical look at how the Refund API works

When you process a refund via WooCommerce, our plugin makes two API requests to the Opayo platform.

The first API request is to – where we need to make a request to this Opayo endpoint to get the RelatedSecurityKey for the order that is being refunded. The payload for this request is the user, password, vendor, command, and the vpstxid (Transaction ID).

This then gives us the RelatedSecurityKey.

After receiving the RelatedSecurityKey, the plugin then makes another API call to which is the refund request, with this we need to pass over the RelatedSecurityKey as part of the payload, then the refund should be processed if all the required data are correct.


Was this helpful?

Opayo - Sage Pay Server

Don't already have the plugin? Get access now.

Still need help?

Our team are on hand to provide fast, helpful and professional support.

Support request

Front End Demo

Test drive our plugin on the demo site.

View Demo

AG Bot (BETA) - Not live chat

Ask our bot about our products.

Welcome to our AG Bot, powered by OpenAI and trained on our documents and product pages. By continuing to use this service, please keep in mind:

Your continued use indicates acceptance of these terms. We hope you find our AI Chatbot useful!

Hello! I am AG Bot, how can I help you? (Not live chat)