/** * Attempt to guess customer country to determine if things should be shown. * * @param string $option payment option * * @return string or null */ public static function deduceCountry($option) { $customer_country_id = isset($_SESSION['customer_country_id']) ? $_SESSION['customer_country_id'] : STORE_COUNTRY; $currency = $_SESSION['currency']; $addr = null; if ($customer_country_id !== null) { $addr = new KlarnaAddr(); $addr->setCountry(self::getCountryByID($customer_country_id)); } $lang = self::getLanguageCode(); self::configureKiTT($option); self::configureKlarna($option); return KiTT::locator()->locate($currency, $lang, $addr); }