WordPress at Your Fingertips
function is not described

WC_Gateway_COD::process_payment() public WC 1.0

Process the payment and return the result.

{} It's a method of the class: WC_Gateway_COD{}

Return

Array.

Usage

$WC_Gateway_COD = new WC_Gateway_COD();
$WC_Gateway_COD->process_payment( $order_id );
$order_id(int) (required)
Order ID.

Code of WC_Gateway_COD::process_payment() WC 5.7.1

public function process_payment( $order_id ) {
	$order = wc_get_order( $order_id );

	if ( $order->get_total() > 0 ) {
		// Mark as processing or on-hold (payment won't be taken until delivery).
		$order->update_status( apply_filters( 'woocommerce_cod_process_payment_order_status', $order->has_downloadable_item() ? 'on-hold' : 'processing', $order ), __( 'Payment to be made upon delivery.', 'woocommerce' ) );
	} else {
		$order->payment_complete();
	}

	// Remove cart.
	WC()->cart->empty_cart();

	// Return thankyou redirect.
	return array(
		'result'   => 'success',
		'redirect' => $this->get_return_url( $order ),
	);
}