/**
  * Prepare to fetch pclasses by building an array of eid and secrets
  *
  * @param string $option 'part' or 'spec'
  *
  * @return array
  */
 public function prepareFetch($option)
 {
     $countries = "";
     // Fethcing the pclasses
     if ($option == 'part') {
         $countries = explode(",", strtolower(MODULE_PAYMENT_KLARNA_PARTPAYMENT_ACTIVATED_COUNTRIES));
     } else {
         if ($option == 'spec') {
             $countries = explode(",", strtolower(MODULE_PAYMENT_KLARNA_SPECCAMP_ACTIVATED_COUNTRIES));
         } else {
             return;
         }
     }
     // Set the array
     $eid_array = array();
     foreach ($countries as $country) {
         $eid_array[$country]['eid'] = KlarnaConstant::merchantID($option, $country);
         $eid_array[$country]['secret'] = KlarnaConstant::secret($option, $country);
     }
     return $eid_array;
 }
 /**
  * The constructor
  *
  * @param string $option 'part', 'spec' or 'invoice'
  *
  * @return void
  */
 public function __construct($option)
 {
     $this->_klarnaDB = new XtcKlarnaDB();
     $currency = $_SESSION['currency'];
     $this->api_version = KlarnaCore::getCurrentVersion();
     $this->jQuery = false;
     $this->enabled = true;
     $this->_option = $option;
     $country = KlarnaUtils::deduceCountry($option);
     $lang = KlarnaUtils::getLanguageCode();
     $this->_country = $country;
     $this->_utils = new KlarnaUtils($country);
     $this->_locale = KiTT::locale($country, $lang, $currency);
     if (KlarnaConstant::isAdmin() && (!array_key_exists('action', $_GET) || !in_array($_GET['action'], array('install', 'remove')))) {
         echo "<link href='" . KlarnaUtils::getStaticPath() . "images.css' type='text/css' rel='stylesheet'/>";
         $this->_checkForLatestVersion();
         $this->description = $this->_buildDescription();
     }
     //Set the title for the payment method. This will be displayed on the
     //confirmation page and the backend order view.
     $this->title = $this->_title();
     $merchantID = KlarnaConstant::merchantID($option, $country);
     $secret = KlarnaConstant::secret($option, $country);
     if (!$merchantID || !$secret) {
         $this->enabled = false;
         return;
     }
     try {
         $this->setupModule();
     } catch (KiTT_Exception $e) {
         if (!KlarnaConstant::isAdmin()) {
             $this->enabled == false;
         }
     }
 }