AAAAhome/academiac/www/plugins/vmpayment/sofort/sofort/library/sofortLib_abstract.inc.php000060400000004522151376515210025320 0ustar00_xmlRootTag] = $this->_parameters; $requestData = $this->_prepareRootTag($requestData); $xmlRequest = ArrayToXml::render($requestData); $this->_log($xmlRequest, ' XmlRequest -> '); $xmlResponse = $this->_sendMessage($xmlRequest); try { $this->_response = XmlToArray::render($xmlResponse); } catch (Exception $e) { $this->_response = array('errors' => array('error' => array('code' => array('@data' => '0999'), 'message' => array('@data' => $e->getMessage())))); } $this->_log($xmlResponse, ' XmlResponse <- '); $this->_handleErrors(); $this->_parseXml(); return $this; } /** * * Log XML with message * @param string $xml * @param string $message */ protected function _log($xml, $message) { $this->log(get_class($this).$message.$xml); } /** * * prepare the root tag * @param array $requestData */ private function _prepareRootTag($requestData) { if ($this->_apiVersion) { $requestData[$this->_xmlRootTag]['@attributes']['version'] = $this->_apiVersion; } if ($this->_validateOnly) { $requestData[$this->_xmlRootTag]['@attributes']['validate_only'] = 'yes'; } return $requestData; } } /// \endcond ?>