Get the endpoint relative to the current

@param string $endpoint
@param string $account

@return string
350762
public function getEndpoint($endpoint, $account = null)
    {
        $isSandbox = (new ConfigurationRepository)->getAccountKey('sandbox', true, $account);

        if ($isSandbox) {
            return $this->resolveUrl(MPESA_SANDBOX, $endpoint);
        }

        return $this->resolveUrl(MPESA_PRODUCTION, $endpoint);
    }
340238
private function parseEndpoint($endpoint)
    {
        $parsed = parse_url($endpoint);

        // parse_url() will correctly parse full URIs with schemes
        if (isset($parsed['host'])) {
            return $parsed;
        }

        // parse_url() will put host & path in 'path' if scheme is not provided
        if (isset($parsed['path'])) {
            $split = explode('/', $parsed['path'], 2);
            $parsed['host'] = $split[0];
            if (isset($split[1])) {
                $parsed['path'] = $split[1];
            } else {
                $parsed['path'] = '';
            }
            return $parsed;
        }

        throw new UnresolvedEndpointException("The supplied endpoint '"
            . "{$endpoint}' is invalid.");
    }
914141
public function findServiceByEndpoint($endpoint)
    {
        $url = $this->getNormalizedUrl($endpoint);

        foreach ($this->services as $service) {
            foreach ($service->getEndpoints() as $endpoint) {
                $endpointUrl = $this->getNormalizedUrl($endpoint->getPublicUrl());
                if (substr($url, 0, strlen($endpointUrl)) === $endpointUrl) {
                    return $service;
                }
            }
        }

        throw new \OutOfBoundsException(sprintf('There is no service for endpoint %s', $url));
    }
4314
public function getEndpoint($name)
    {
        return array_key_exists($name, $this->endpointsByName) ? $this->endpointsByName[$name] : null;
    }
82018
public function getEndpoint($endpoint)
    {
        // Get Endpoint Class name
        $endpoint = studly_case($endpoint);

        if (!array_key_exists($endpoint, $this->endpoints)) {
            throw new InvalidEndpointException("Endpoint {$endpoint} does not exists");
        }

        $class = $this->endpoints[$endpoint];

        // Check if an instance has already been initiated
        if (isset($this->cachedEndpoints[$endpoint]) === false) {
            // check if class is an EndPoint
            $endpointClass = new \ReflectionClass($class);
            if (!$endpointClass->isSubclassOf('Atog\Api\Endpoint')) {
                throw new InvalidEndpointException("Class {$class} does not extend Atog\\Api\\Endpoint");
            }
            
            // check for model
            $model = new Model();
            if (array_key_exists('models', $this->config) && array_key_exists($endpoint, $this->config['models'])) {
                $modelClass = $this->config['models'][$endpoint];
                if (class_exists($modelClass)) {
                    $model = new $modelClass();
                }
            }
            $this->cachedEndpoints[$endpoint] = new $class($this, $model);
        }
        
        return $this->cachedEndpoints[$endpoint];
    }
1156084
protected function configureEndpoint(EndpointInterface $Endpoint, $action)
    {
        switch ($action) {
            case self::ACTION_AUTH:
                $Endpoint = $this->configureAuthenticationEndpoint($Endpoint);
                break;
            case self::ACTION_LOGOUT:
                $Endpoint = $this->configureLogoutEndpoint($Endpoint);
                break;
        }
        return $Endpoint;
    }
956849
private function getOrCreateEndpoint($endpoint)
    {
        if (!array_key_exists($endpoint, $this->endpoints)) {
            if (!array_key_exists($endpoint, self::$endpointClassMap)) {
                throw new \Exception(sprintf('Unknown endpoint "%s"', $endpoint));
            }

            $endpointClass = self::$endpointClassMap[$endpoint];
            $this->endpoints[$endpoint] = $this->createEndpoint($endpointClass);
        }

        return $this->endpoints[$endpoint];
    }
704561
private function getEndpoint($type)
    {
        if (!array_key_exists($type, $this->endpoints)) {
            $this->endpoints[$type] = SearchEndpointFactory::get($type);
        }

        return $this->endpoints[$type];
    }
532900
protected function getEndpoint($method)
    {
        $endpoint = "credit_cards";
        $cardId = $this->getArgument("id");
        if (!is_null($cardId)) {
            $endpoint .= "/$cardId";
            $this->delArgument("id");
        }
        return $endpoint;
    }
237633
private function getEndpointUrl($type)
    {
        switch ($this->config['bank']) {
            case static::BANK_CM:
                $host = 'https://paiement.creditmutuel.fr/';
                break;
            case static::BANK_CIC:
                $host = 'https://ssl.paiement.cic-banques.fr/';
                break;
            case static::BANK_OBC:
                $host = 'https://ssl.paiement.banque-obc.fr/';
                break;
            default:
                throw new RuntimeException('Failed to determine the endpoint host.');
        }

        switch ($type) {
            case static::TYPE_PAYMENT:
                $path = 'paiement.cgi';
                break;
            case static::BANK_CIC:
                $path = 'capture_paiement.cgi';
                break;
            case static::BANK_OBC:
                $path = 'recredit_paiement.cgi';
                break;
            default:
                throw new RuntimeException('Failed to determine the endpoint path.');
        }

        if ($this->config['mode'] === static::MODE_TEST) {
            $path = 'test/' . $path;
        }

        return $host . $path;
    }
874807
protected function getEndpoint($method)
    {
        $endpoint = "tariffs";
        $countryIso = $this->getArgument("id");
        if (!is_null($countryIso)) {
            $endpoint .= "/$countryIso";
            $this->delArgument("id");
        }
        return $endpoint;
    }
19445
public function get($endpoint, array $parameters = array())
    {
        if (!empty($parameters)) {
            $path = sprintf("%s/?%s", $endpoint, http_build_query($parameters));
        } else {
            $path = $endpoint;
        }

        return $this->execute("GET", sprintf("%s%s", $this->host, $path));
    }
284994
public function getBalanceByAccount($account)
    {
        $args = [
            (string)$account,
            $this->minconf
        ];
        return $this->rpc->query("getBalance", $args);
    }
1161652
protected function getEndpoint($method)
    {
        $endpoint = 'me/password';
        $reset = $this->getArgument('reset');
        $nonce = $this->getArgument('nonce');
        if (!is_null($reset)) {
            $endpoint .= '/reset';
            $this->delArgument('reset');
        }
        if (!is_null($nonce)) {
            $endpoint .= "/$nonce";
            $this->delArgument('nonce');
        }
        return $endpoint;
    }
575896
public function getRawChangeAddress($account)
    {
        $args = [
            (string)$account
        ];
        return $this->rpc->query(__FUNCTION__, $args);
    }
610329
def endpoint_get(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.get_endpoint(**kwargs)
1354644
protected function getOrigin($endPoint)
    {
        $url = parse_url($endPoint);
        $origin = $url['scheme'].'://'.$url['host'];
        if (isset($url['port'])) {
            $origin = $origin.':'.$url['port'];
        }

        return $origin;
    }