/** * Backports wc_checkout_is_https() to 2.4.x * * @since 4.3.0-beta * @return bool */ public static function wc_checkout_is_https() { if (self::is_wc_version_gte_2_5()) { return wc_checkout_is_https(); } else { return wc_site_is_https() || 'yes' === get_option('woocommerce_force_ssl_checkout') || class_exists('WordPressHTTPS') || strstr(wc_get_page_permalink('checkout'), 'https:'); } }
/** * Check if this gateway is enabled. * * @return bool */ public function is_available() { if ('yes' !== $this->enabled) { return false; } if ('standard' === $this->mode && 'yes' !== $this->sandbox && !wc_checkout_is_https()) { return false; } if (!$this->public_key || !$this->private_key) { return false; } return true; }