Automattic\WooCommerce\StoreApi\Routes\V1

Checkout::process_without_payment()privateWC 1.0

For orders which do not require payment, just update status.

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

Хуков нет.

Возвращает

null. Ничего.

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

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

Код Checkout::process_without_payment() WC 6.7.0

private function process_without_payment( \WP_REST_Request $request, PaymentResult $payment_result ) {
	// Transition the order to pending, and then completed. This ensures transactional emails fire for pending_to_complete events.
	$this->order->update_status( 'pending' );
	$this->order->payment_complete();

	// Mark the payment as successful.
	$payment_result->set_status( 'success' );
	$payment_result->set_redirect_url( $this->order->get_checkout_order_received_url() );
}