/**
  * Returns filtered list of services which may process pickings with provided declared weight
  * @param array $arrSelectedServices Selected list service identofiers - integers
  * @param double $weightDeclared Declared weight of picking
  * @param EPSFacade $eps EPS client instance
  * @param integer $senderSiteId Sender site ID
  * @param integer $receiverSiteId Receiver site Id
  * @param date $date Date
  * @param boolean $documents Document flag
  * @return array of integers - List of service Ids
  */
 public static function filterServicesByWeightIntervals($arrSelectedServices, $weightDeclared, $eps, $senderSiteId, $receiverSiteId, $date, $documents)
 {
     $arrResult = array();
     if (isset($arrSelectedServices) && is_array($arrSelectedServices)) {
         $j = 0;
         for ($i = 0; $i < count($arrSelectedServices); ++$i) {
             $weightInterval = $eps->getWeightInterval($arrSelectedServices[$i], $senderSiteId, $receiverSiteId, $date, $documents);
             if (isset($weightInterval)) {
                 if ($weightInterval->getMinValue() <= $weightDeclared && $weightDeclared <= $weightInterval->getMaxValue()) {
                     $arrResult[$j] = $arrSelectedServices[$i];
                     $j++;
                 }
             }
         }
     }
     return $arrResult;
 }
Exemple #2
0
 /** Checks Credentials of user
  * @param $username
  * @param $password
  * @return bool|\ResultLogin
  */
 public function checkCredentials($username, $password)
 {
     $this->ePSFacade->setUsername($username);
     $this->ePSFacade->setPassword($password);
     try {
         return $this->ePSFacade->login();
     } catch (\ClientException $ce) {
         return FALSE;
     } catch (\ServerException $se) {
         return FALSE;
     }
 }
Exemple #3
0
 /**
  * Sets EPS Facade Client
  */
 protected function setClient()
 {
     $this->client = $this->eps_facade->getClientById($this->connection->getClientId());
     return $this;
 }
     $timeZone = getenv("TZ");
 }
 echo "<pre>";
 echo "<br><br>";
 echo "=========================================================================================================<br>";
 echo "НАЧАЛО<br>";
 echo "=========================================================================================================<br>";
 echo "<i><small><strong>(PHP Version: " . phpversion() . ", PHP EPS Client Library Version: " . Util::getLibVersion() . ", Time zone: " . $timeZone . ")</strong></small></i><br><br><br>";
 echo "--------------------------------------------------------------------------------------------------------<br>";
 echo "USER NAME: " . $clientConfiguration->userName . "<br>";
 echo "--------------------------------------------------------------------------------------------------------<br><br>";
 //-------------------------------------------------------------------------------------------------------------------
 // ИНИЦИАЛИЗАЦИЯ И ПРЕДВАРИТЕЛНА КАЛКУЛАЦИЯ НА ЦЕНА
 //-------------------------------------------------------------------------------------------------------------------
 // Инициализация на интерфейса към EPS на Спиди със SOAP имплементация
 $eps = new EPSFacade(new EPSSOAPInterfaceImpl(), $clientConfiguration->userName, $clientConfiguration->userPassword);
 // Установяване на сесия
 echo "Установяване на сесия [login]<br>";
 $resultLogin = $eps->getResultLogin();
 echo "--------------------------------------------------------------------------------------------------------<br>";
 echo "TIMESTAMP: " . date('y-m-d H:i:s T', time()) . "  CLIENTID: " . $resultLogin->getClientId() . "  SESSIONID: " . $resultLogin->getSessionId() . "<br>";
 echo "--------------------------------------------------------------------------------------------------------<br>";
 // Извличане данните на регистрирания потребител на EPS (в този пример - ПОДАТЕЛЯ)
 echo "<br><br><br><br>";
 echo "------------------------------------------------------------------------------------------------<br>";
 echo "Извличане на данни за подателя (клиента на EPS) от профила в системата на Speedy [getClientById]<br>";
 echo "------------------------------------------------------------------------------------------------<br>";
 echo "Параметри:<br>";
 echo "    {clientId}: " . $resultLogin->getClientId() . "<br>";
 $senderClientData = $eps->getClientById($resultLogin->getClientId());
 echo "<br><br>";