/** * Sets the active country from a ISO country string * or a KlarnaCountry constant */ public function setCountry($country) { if (!is_numeric($country)) { $country = KlarnaCountry::fromCode($country); } else { $country = intval($country); } if ($this->oKlarna == NULL) { throw new KlarnaApiException('Error in ' . __METHOD__ . ': Klarna instance not set'); } $this->iKlarnaCountry = $country; $this->iKlarnaCurrency = $this->oKlarna->getCurrencyForCountry($country); $this->sCountryCode = $this->oKlarna->getCountryCode($country); }