public function setEnvironment($value)
{
$env = strtolower($value);
if (!isset($this->endpoints[$env])) {
throw new InvalidRequestException('The environment is invalid');
}
$this->setEndpoint($this->endpoints[$env]);
return $this;
}