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.

Метод класса: WC_Order{}

Хуки из метода

Возвращает

Строку.

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

$WC_Order = new WC_Order();
$WC_Order->get_checkout_payment_url( $on_checkout );
$on_checkout(true|false)
If on checkout.
По умолчанию: false

Код WC_Order::get_checkout_payment_url() WC 8.7.0

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 );
}