示例#1
0
 protected function parseRawResponse(Zend_Http_Response $response)
 {
     parent::parseRawResponse($response);
     if ($this->isSuccessful()) {
         $data = $this->xmlToArray($this->getXml());
         $this->successful = false;
         if (isset($data['response'])) {
             if (strtolower($data['response']) == 'success') {
                 $this->successful = true;
             }
             unset($data['response']);
         }
         foreach ($data as $key => $value) {
             $this->setData($this->_underscore($key), $value);
         }
     }
     return $this;
 }
示例#2
0
 protected function parseRawResponse(Zend_Http_Response $response)
 {
     parent::parseRawResponse($response);
     if ($this->isSuccessful()) {
         $xml = $this->getXml();
         if (isset($xml->status) && strtolower($xml->status) === "success") {
             $this->successful = true;
         } else {
             $this->successful = false;
         }
         if (isset($xml->msg)) {
             $this->setMessage((string) $xml->msg);
         }
         if (isset($xml->sessionId)) {
             $this->setSessionId((string) $xml->sessionId);
         }
     }
     return $this;
 }
示例#3
0
 protected function parseRawResponse(Zend_Http_Response $response)
 {
     parent::parseRawResponse($response);
     if ($this->isSuccessful()) {
         $data = $this->xmlToArray($this->getXml());
         $this->successful = false;
         if (isset($data['response'])) {
             if (strtolower($data['response']) == 'success') {
                 $this->successful = true;
             }
             unset($data['response']);
         }
         foreach ($data as $key => $value) {
             switch ($key) {
                 case 'result':
                     $prepared_value = $value;
                     if (isset($value['id'])) {
                         $prepared_value = array($value);
                     }
                     break;
                 case 'filters':
                     if (isset($value['filter'])) {
                         $prepared_value = $this->_prepareFilters($value['filter']);
                     } else {
                         $prepared_value = '';
                     }
                     break;
                 default:
                     $prepared_value = $value;
                     break;
             }
             $this->setData($this->_underscore($key), $prepared_value);
         }
     }
     return $this;
 }