WC_Order::get_checkout_payment_url()publicWC 1.0

Generates a URL so that a customer can pay for their (unpaid - pending) order. Pass 'true' for the checkout version which doesn't offer gateway choices.

Method of the class: WC_Order{}

Hooks from the method

Return

String.

Usage

$WC_Order = new WC_Order();
$WC_Order->get_checkout_payment_url( $on_checkout );
$on_checkout(true|false)
If on checkout.
Default: false

WC_Order::get_checkout_payment_url() code WC 9.4.2

public function get_checkout_payment_url( $on_checkout = false ) {
	$pay_url = wc_get_endpoint_url( 'order-pay', $this->get_id(), wc_get_checkout_url() );

	if ( $on_checkout ) {
		$pay_url = add_query_arg( 'key', $this->get_order_key(), $pay_url );
	} else {
		$pay_url = add_query_arg(
			array(
				'pay_for_order' => 'true',
				'key'           => $this->get_order_key(),
			),
			$pay_url
		);
	}

	return apply_filters( 'woocommerce_get_checkout_payment_url', $pay_url, $this );
}