예제 #1
0
 /**
  * Returns all the errors
  * return Array
  */
 public function getErrors()
 {
     if (empty($this->_errors)) {
         $errorList = array();
         foreach ($this->__get(self::$ERROR) as $error) {
             $errorCode = $error[self::$ERROR_ERROR_CODE];
             $message = $error[self::$ERROR_MESSAGE];
             $consumerMessage = $error[self::$ERROR_CONSUMER_MESSAGE];
             $paySysMessage = $error[self::$ERROR_PAY_SYS_MESSAGE];
             $errorObject = new WirecardCEE_QMore_Error($errorCode, $message);
             $errorObject->setPaySysMessage($paySysMessage);
             $errorObject->setConsumerMessage($consumerMessage);
             array_push($errorList, $errorObject);
         }
         $this->_errors = $errorList;
     }
     return $this->_errors;
 }
예제 #2
0
 /**
  * getter for list of errors that occured
  *
  * @return WirecardCEE_QMore_Error[]
  */
 public function getErrors()
 {
     $aErrors = array();
     if (empty($this->_errors)) {
         if (is_array($this->_getField(self::$ERROR))) {
             foreach ($this->_getField(self::$ERROR) as $error) {
                 $errorCode = isset($error[self::$ERROR_CODE]) ? $error[self::$ERROR_CODE] : 0;
                 $message = isset($error[self::$ERROR_MESSAGE]) ? $error[self::$ERROR_MESSAGE] : '';
                 $consumerMessage = isset($error[self::$ERROR_CONSUMER_MESSAGE]) ? $error[self::$ERROR_CONSUMER_MESSAGE] : '';
                 $paySysMessage = isset($error[self::$ERROR_PAYSYS_MESSAGE]) ? $error[self::$ERROR_PAYSYS_MESSAGE] : '';
                 $error = new WirecardCEE_QMore_Error($errorCode, $message);
                 $error->setConsumerMessage($consumerMessage);
                 $error->setPaySysMessage($paySysMessage);
                 $aErrors[] = $error;
             }
         }
         $this->_errors = $aErrors;
     }
     return $this->_errors;
 }