public function send(Notice $notice)
{
$curl = curl_init();
$xml = $notice->toXml($this->configuration);
curl_setopt($curl, CURLOPT_URL, $this->configuration->get('apiEndPoint'));
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, $this->configuration->get('timeout'));
curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
curl_setopt($curl, CURLOPT_HTTPHEADER, $this->headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
// HTTP proxy support
$proxyHost = $this->configuration->get('proxyHost');
$proxyUser = $this->configuration->get('proxyUser');
if (null !== $proxyHost) {
curl_setopt($curl, CURLOPT_PROXY, $proxyHost . ':' . $this->configuration->get('proxyPort'));
if (null !== $proxyUser) {
curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUser . ':' . $this->configuration->get('proxyPass'));
}
}
$return = curl_exec($curl);
curl_close($curl);
return $return;
}