diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index 686846abe78..08451515652 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -972,6 +972,8 @@ class WC_Checkout { // Redirect to success/confirmation/payment page. if ( isset( $result['result'] ) && 'success' === $result['result'] ) { + $result['order_id'] = $order_id; + $result = apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ); if ( ! is_ajax() ) { diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index 374668efcf8..b182f6a6de0 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -440,6 +440,8 @@ class WC_Form_Handler { // Redirect to success/confirmation/payment page. if ( isset( $result['result'] ) && 'success' === $result['result'] ) { + $result['order_id'] = $order_id; + $result = apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ); wp_redirect( $result['redirect'] ); //phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect