Documentation

Add_filter | Form, Server, Direct & Pi | Add Custom Paid Order Statuses

We’ve put this guide together as a little helping hand for developers and designers. You’ll need a basic understanding of PHP to make the most of it.

Just a quick heads-up, we can’t provide support for custom code or offer any bespoke tweaks. Think of the snippets below as examples to guide you in the right direction.

Overview

This filter allows you to add your own custom order statuses that the plugin should treat as “paid”.

By default, orders with the following statuses are considered paid, and the webhook won’t trigger or re-payment attempt:

  • processing
  • completed
  • on-hold

If your store uses additional custom statuses (for example awaiting-shipment or partially-refunded), you can include them here, so the plugin recognises them too.

This is especially useful if you have a workflow where orders move through custom post-payment states.

How to Use

Add the following snippet to your site (for example, in your child theme’s functions.php file or a custom plugin)

php
1234567891011121314151617181920212223
/**
 * Add custom order statuses that should be treated as "paid" by the plugin.
 *
 * The plugin checks these statuses before updating orders — if the order
 * already has one of them, it skips the updating.
 *
 * ----------------------------------------------------------
 * Default statuses: processing, completed, on-hold
 *
 * Example: add one or more of your own custom statuses below.
 */
add_filter( 'ag_paid_order_statuses', 'ag_add_custom_paid_statuses' );

function ag_add_custom_paid_statuses( $statuses ) {
	// Add your custom status slugs here (no "wc-" prefix)
	$custom_statuses = array(
		'awaiting-shipment',
		'partially-refunded',
	);

	// Merge and return
	return array_merge( $statuses, $custom_statuses );
}

Example Explained

In the example above, we:

  • Define a list of our custom statuses
  • Merge them with the plugin’s existing “paid” statuses (processing, completed, on-hold)
  • Return the updated array so the plugin recognises them

Now, when an order has one of your custom statuses, the plugin will treat it as paid and skip any further redirect or payment actions

 

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