public function onLog(Event $event)
 {
     if ($this->enabled === true) {
         $log = new AirpayLog();
         $log->setErrorCode($event->getErrorCode());
         $log->setTitle($event->getTitle());
         if ($event->getPayment()) {
             $log->setPayment($event->getPayment());
         }
         $log->setLoggedAt(new \DateTime());
         $log->setRequestGet($this->request->query->all());
         $log->setRequestPost($this->request->request->all());
         $this->em->persist($log);
         $this->em->flush($log);
     }
 }