WC_Payment_Gateway::get_return_url PHP Method

get_return_url() public method

Get the return url (thank you page).
public get_return_url ( WC_Order $order = null ) : string
$order WC_Order
return string
    public function get_return_url($order = null)
    {
        if ($order) {
            $return_url = $order->get_checkout_order_received_url();
        } else {
            $return_url = wc_get_endpoint_url('order-received', '', wc_get_page_permalink('checkout'));
        }
        if (is_ssl() || get_option('woocommerce_force_ssl_checkout') == 'yes') {
            $return_url = str_replace('http:', 'https:', $return_url);
        }
        return apply_filters('woocommerce_get_return_url', $return_url, $order);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Get normal return URL
  * @see https://github.com/woothemes/woocommerce/blob/v2.1.3/includes/abstracts/abstract-wc-payment-gateway.php#L52
  * @return string
  */
 public function get_normal_return_url()
 {
     return $this->gateway->get_return_url($this->order);
 }