public function setCurrency($currency) { if (!in_array(strtoupper($currency), $this->allowedcurrencies)) { throw new InvalidArgumentException("Unknown currency"); } $this->parameters['currency'] = $currency; }