コード例 #1
0
 /**
  * Retrieves the specified PClasses.
  *
  * <b>Type can be</b>:<br>
  * {@link KlarnaPClass::CAMPAIGN}<br>
  * {@link KlarnaPClass::ACCOUNT}<br>
  * {@link KlarnaPClass::SPECIAL}<br>
  * {@link KlarnaPClass::FIXED}<br>
  * {@link KlarnaPClass::DELAY}<br>
  * {@link KlarnaPClass::MOBILE}<br>
  *
  * @param int $type PClass type identifier.
  *
  * @throws KlarnaException
  * @return array An array of PClasses. [KlarnaPClass]
  */
 public function getPClasses($type = null)
 {
     $this->_checkConfig();
     if (!$this->pclasses) {
         $this->pclasses = $this->getPCStorage();
         $this->pclasses->load($this->pcURI);
     }
     $tmp = $this->pclasses->getPClasses($this->_eid, $this->_country, $type);
     $this->sortPClasses($tmp[$this->_eid]);
     return $tmp[$this->_eid];
 }
コード例 #2
0
ファイル: klarna.php プロジェクト: Gskflute/joomla25
 /**
  * Retrieves the specified PClasses.
  *
  * <b>Type can be</b>:<br>
  * {@link KlarnaPClass::CAMPAIGN}<br>
  * {@link KlarnaPClass::ACCOUNT}<br>
  * {@link KlarnaPClass::SPECIAL}<br>
  * {@link KlarnaPClass::FIXED}<br>
  * {@link KlarnaPClass::DELAY}<br>
  * {@link KlarnaPClass::MOBILE}<br>
  *
  * @param  int   $type  PClass type identifier.
  * @throws KlarnaException
  * @return array An array of PClasses. [KlarnaPClass]
  */
 public function getPClasses($type = null)
 {
     try {
         if (!$this->config instanceof ArrayAccess) {
             throw new Exception('Klarna instance not fully configured!', 50001);
         }
         if (!$this->pclasses) {
             $this->pclasses = $this->getPCStorage();
             $this->pclasses->load($this->pcURI);
         }
         $tmp = $this->pclasses->getPClasses($this->eid, $this->country, $type);
         $this->sortPClasses($tmp[$this->eid]);
         return $tmp[$this->eid];
     } catch (Exception $e) {
         throw new KlarnaException('Error in ' . __METHOD__ . ': ' . $e->getMessage(), $e->getCode());
     }
 }
コード例 #3
0
 /**
  * Retrieves the specified PClasses.
  *
  * <b>Type can be</b>:<br>
  * {@link KlarnaPClass::CAMPAIGN}<br>
  * {@link KlarnaPClass::ACCOUNT}<br>
  * {@link KlarnaPClass::SPECIAL}<br>
  * {@link KlarnaPClass::FIXED}<br>
  * {@link KlarnaPClass::DELAY}<br>
  * {@link KlarnaPClass::MOBILE}<br>
  *
  * @param int $type PClass type identifier.
  *
  * @throws KlarnaException
  * @return array An array of PClasses. [KlarnaPClass]
  */
 public function getPClasses($type = null)
 {
     if (!$this->config instanceof ArrayAccess) {
         throw new Klarna_IncompleteConfigurationException();
     }
     if (!$this->pclasses) {
         $this->pclasses = $this->getPCStorage();
         $this->pclasses->load($this->pcURI);
     }
     $tmp = $this->pclasses->getPClasses($this->_eid, $this->_country, $type);
     $this->sortPClasses($tmp[$this->_eid]);
     return $tmp[$this->_eid];
 }