diff --git a/includes/class-wc-payment-gateway-wcpay.php b/includes/class-wc-payment-gateway-wcpay.php index 65013032eea..d5a32dd11e1 100644 --- a/includes/class-wc-payment-gateway-wcpay.php +++ b/includes/class-wc-payment-gateway-wcpay.php @@ -1073,7 +1073,7 @@ function_exists( 'wcs_order_contains_subscription' ) * * @param WC_Order $order Order that needs payment. * @return array|null Array if processed, null if the new process is not supported. - * @throws New_Process_Payment_Exception Error processing the payment. + * @throws Exception Error processing the payment. */ public function new_process_payment( WC_Order $order ) { $manual_capture = $this->get_capture_type() === Payment_Capture_Type::MANUAL(); @@ -1119,7 +1119,7 @@ public function new_process_payment( WC_Order $order ) { ]; } - throw new New_Process_Payment_Exception( __( 'The payment process could not be completed.', 'woocommerce-payments' ) ); + throw new Exception( __( 'The payment process could not be completed.', 'woocommerce-payments' ), 0, new New_Process_Payment_Exception() ); } /** diff --git a/tests/unit/test-class-wc-payment-gateway-wcpay.php b/tests/unit/test-class-wc-payment-gateway-wcpay.php index 7a86e78ca89..5ff88347d18 100644 --- a/tests/unit/test-class-wc-payment-gateway-wcpay.php +++ b/tests/unit/test-class-wc-payment-gateway-wcpay.php @@ -3640,7 +3640,7 @@ public function test_new_process_payment_throw_exception() { $this->card_gateway->process_payment( $order->get_id() ); - $this->expectException( New_Process_Payment_Exception::class ); + $this->expectException( Exception::class ); $this->expectExceptionMessage( 'The payment process could not be completed.' ); }