WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

Automattic\WooCommerce\Blocks\StoreApi\Routes

Checkout::process_payment() private WC 1.0

Fires an action hook instructing active payment gateways to process the payment for an order and provide a result.

{} Это метод класса: Checkout{}

Возвращает

PaymentResult. Ничего.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->process_payment( $request );
$request(WP_REST_Request) (обязательный)
Request object.

Код Checkout::process_payment() WC 5.2.2

<?php
private function process_payment( WP_REST_Request $request ) {
	try {
		$result  = new PaymentResult();
		$context = new PaymentContext();
		$context->set_payment_method( $this->get_request_payment_method_id( $request ) );
		$context->set_payment_data( $this->get_request_payment_data( $request ) );

		// Orders are made pending before attempting payment.
		$this->order->update_status( 'pending' );
		$context->set_order( $this->order );

		/**
		 * Process payment with context.
		 *
		 * @hook woocommerce_rest_checkout_process_payment_with_context
		 *
		 * @throws Exception If there is an error taking payment, an Exception object can be thrown
		 *                                     with an error message.
		 *
		 * @param PaymentContext $context Holds context for the payment, including order ID and payment method.
		 * @param PaymentResult  $result Result object for the transaction.
		 */
		do_action_ref_array( 'woocommerce_rest_checkout_process_payment_with_context', [ $context, &$result ] );

		if ( ! $result instanceof PaymentResult ) {
			throw new RouteException( 'woocommerce_rest_checkout_invalid_payment_result', __( 'Invalid payment result received from payment method.', 'woocommerce' ), 500 );
		}

		return $result;
	} catch ( Exception $e ) {
		throw new RouteException( 'woocommerce_rest_checkout_process_payment_error', $e->getMessage(), 400 );
	}
}