WordPress filter hook

woocommerce_payment_successful_result

Defined by WooCommerce and fired by 15 plugins in total, running on 7M+ sites between them.

“This filter is documented in woocommerce/includes/class-wc-checkout.php.”

How to use woocommerce_payment_successful_result

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_payment_successful_result', function( $result, $order_id ) {
	// Change $result here.
	return $result;
}, 10, 2 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

15 plugins that fire woocommerce_payment_successful_result

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ) includes/class-wc-checkout.php:1279
  2. Payment Gateway for PayPal on WooCommerce icon Payment Gateway for PayPal on WooCommerce10,000+ installs apply_filters( 'woocommerce_payment_successful_result', array('result' => 'success'), $woo_order_id ) ppcp/includes/class-ppcp-paypal-checkout-for-woocommerce-request.php:1659
  3. Amazon Pay for WooCommerce icon Amazon Pay for WooCommerce10,000+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ) includes/class-wc-gateway-amazon-payments-advanced.php:3096
  4. Revolut Gateway for WooCommerce icon Revolut Gateway for WooCommerce7,000+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $wc_order_id ) includes/class-wc-revolut-payment-ajax-controller.php:152
  5. PayPlug for WooCommerce (Official) icon PayPlug for WooCommerce (Official)4,000+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ) src/PayplugWoocommerceRequest.php:274
  6. Checkout with Zelle on Woocommerce icon Checkout with Zelle on Woocommerce3,000+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $order->get_id() ) includes/class-wc_zelle_popup_order.php:284
  7. Sezzle Woocommerce Payment icon Sezzle Woocommerce Payment1,000+ installs apply_filters( 'woocommerce_payment_successful_result', ['result' => 'success', 'redirect' => $this->get_return_url($order)], $order->get_id() ) woocommerce-gateway-sezzle.php:2383
  8. Androapp icon Androapp300+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $orderId ) class-pw-wp-woo.php:1445
  9. Bolt Checkout for WooCommerce icon Bolt Checkout for WooCommerce100+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ) includes/classes/class-bolt-checkout.php:1057
  10. BlueSnap Payment Gateway for WooCommerce icon BlueSnap Payment Gateway for WooCommerce90+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ) includes/class-wc-bluesnap-payment-request.php:491
  11. Radin app icon Radin app10+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $order->get_id() ) includes/API/Controller/OrderControllerRadinapp.php:195
  12. Briqpay for WooCommerce icon Briqpay for WooCommerce10+ installs apply_filters( 'woocommerce_payment_successful_result', array('result' => 'success', 'redirect' => $url), $order->get_id() ) includes/class-checkout-handler.php:3072
  13. Raif payment icon Raif payment10+ installs apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ) includes/class-gateway.php:787
  14. Vanquish Deposits icon Vanquish DepositsFewer than 10 installs apply_filters( 'woocommerce_payment_successful_result', $result, $first->get_id() ) includes/Checkout/Classic.php:68
  15. Single Page Shopping icon Single Page ShoppingFewer than 10 installs apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ) includes/class-awcs-form-handler.php:498

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.