Cartalyst\Stripe\Stripe::getApiInstance PHP Method

getApiInstance() protected method

Returns the Api class instance for the given method.
protected getApiInstance ( string $method ) : Cartalyst\Stripe\Api\ApiInterface
$method string
return Cartalyst\Stripe\Api\ApiInterface
    protected function getApiInstance($method)
    {
        $class = "\\Cartalyst\\Stripe\\Api\\" . ucwords($method);
        if (class_exists($class)) {
            return new $class($this->config);
        }
        throw new \BadMethodCallException("Undefined method [{$method}] called.");
    }