Пример #1
0
 /**
  * Read through the entire document
  *
  * @param \XMLReader $reader
  * @return mixed
  */
 public function readerLoop($reader)
 {
     $tree = new \stdClass();
     while ($reader->read()) {
         switch ($reader->nodeType) {
             case \XMLReader::END_ELEMENT:
                 return $tree;
             case \XMLReader::ELEMENT:
                 $this->processElement($reader, $tree);
                 if ($reader->hasAttributes) {
                     $this->processAttributes($reader, $tree);
                 }
                 break;
             case \XMLReader::TEXT:
             case \XMLReader::CDATA:
                 $tree = \Genesis\Utils\Common::stringToBoolean(trim($reader->expand()->textContent));
                 break;
         }
     }
     return $tree;
 }
Пример #2
0
 /**
  * Check whether the transaction was partially approved
  *
  * @see Genesis_API_Documentation for more information
  *
  * @return bool | null (if inapplicable)
  */
 public function isPartiallyApproved()
 {
     if (isset($this->responseObj->partial_approval)) {
         return \Genesis\Utils\Common::stringToBoolean($this->responseObj->partial_approval);
     }
     return null;
 }