public function setBrand($brand) { if (!array_key_exists($brand, $this->brandsmap)) { throw new InvalidArgumentException("Unknown Brand [{$brand}]."); } $this->setPaymentMethod($this->brandsmap[$brand]); $this->parameters['brand'] = $brand; }