$order_id = 123; // Replace with your order ID
$payment_url = get_payment_link_for_order( $order_id );
if ( $payment_url ) {
echo ‘Payment Link: ‘ . esc_url( $payment_url );
} else {
echo ‘This order does not require payment or is already paid.’;
}