private function sendCallback(NotificationInterface $notification, ObjectManager $om) { if ($notification->getCallbackUrl()) { $secret = $notification->getCategory()->getClient()->getSecret(); $base['data'] = json_encode(array('id' => $notification->getId(), 'person_id' => $notification->getPerson()->getId(), 'read_date' => $notification->getReadDate()->getTimestamp())); $base['signature'] = hash_hmac('sha256', $base['data'], $secret); $dataPost = http_build_query($base); curl_setopt($this->ch, CURLOPT_URL, $notification->getCallbackUrl()); curl_setopt($this->ch, CURLOPT_POST, 1); curl_setopt($this->ch, CURLOPT_POSTFIELDS, $dataPost); $curlResponse = curl_exec($this->ch); $code = curl_getinfo($this->ch, CURLINFO_HTTP_CODE); if ($code != '200') { $this->registerFailedCallback($notification, $om, $this->ch, $curlResponse); } } }