/** * @param Payone_Api_Request_Interface $request * @param Exception * @return boolean */ public function saveException(Payone_Api_Request_Interface $request, Exception $ex) { $domainObject = $this->getFactory()->getModelApi(); $domainObject->setData($request->toArray()); $domainObject->setRawRequest($request->__toString()); $domainObject->setStacktrace($ex->getTraceAsString()); $domainObject->setResponse(Payone_Core_Model_System_Config_ResponseType::EXCEPTION); $domainObject->save(); }
/** * @param Exception $e * @param null|Payone_Api_Request_Interface $request */ public function protocolException(Exception $e, Payone_Api_Request_Interface $request = null) { foreach ($this->loggers as $key => $logger) { /** @var $logger Payone_Protocol_Logger_Interface */ $logger->log(get_class($e) . ' ' . $e->getMessage(), Payone_Protocol_Logger_Interface::LEVEL_ERROR); if ($request !== null) { $requestAsString = $request->__toString(); $logger->log($requestAsString, Payone_Protocol_Logger_Interface::LEVEL_ERROR); } } foreach ($this->repositories as $key => $repository) { /** @var $repository Payone_Api_Persistence_Interface */ $repository->saveException($request, $e); } }