Documentation

Add_filter | Form, Server & Direct | Modify the Payload Sent to Opayo

Note

Just a heads-up: This document is a friendly guide intended for developers and designers. A bit of PHP know-how is needed to get the most out of it.

Please remember, while we love to be helpful, our support policy doesn’t extend to customisations.

Think of any sample code we provide as a starting point or inspiration for your projects!

Overview

This filter allows developers to modify the payload data being sent to the Opayo API before the transaction is processed. It’s useful if you want to inject custom fields, change values, or perform conditional logic based on the order data.

Usage

To use the ag_opayo_modify_payload filter, add the following snippet to your functions.php file or a custom plugin:

Parameters

  • $data (array)
The full payload array that will be sent to the Opayo API.
You can inspect or modify any fields here.
  • $order (WC_Order)
The WooCommerce order object related to the transaction.

Caution

Ensure that any changes made still comply with Opayo’s payload format, or the transaction may be rejected.

If you’re adding custom data not expected by Opayo, it may cause payment errors.

Was this helpful?

Opayo

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
All systems operational

Back End Demo

Start exploring our fully functional demo site today.
Gain exclusive admin access to see what's possible.

Create your demo now

Front End Demo

Test drive our plugin on the demo site.

View Demo