Esempio n. 1
0
 public function __construct(IDeal $ideal)
 {
     parent::__construct($ideal, self::ROOT_NAME);
     $this->setLanguage(IDeal::DUTCH);
     $this->setCurrency(IDeal::EURO);
     $this->setTimeoutAt(new DateTime('now + 15 minutes'));
 }
Esempio n. 2
0
 public function __construct(IDeal $ideal)
 {
     parent::__construct($ideal, self::ROOT_NAME);
 }
Esempio n. 3
0
 public function send(Request\Request $request)
 {
     if (!$request->isSigned()) {
         $request->sign();
     }
     $curl = curl_init($this->getBaseUrl());
     curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
     curl_setopt($curl, CURLOPT_HEADER, true);
     curl_setopt($curl, CURLOPT_POSTFIELDS, $request->getDocumentString());
     curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=UTF-8'));
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     if ($this->verification === false) {
         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
     }
     if ($this->proxyUrl != null) {
         curl_setopt($curl, CURLOPT_PROXY, $this->proxyUrl);
     }
     $response = curl_exec($curl);
     if ($this->proxyUrl != null) {
         // Clear up proxy response:
         if (stripos($response, "HTTP/1.0 200 Connection established\r\n\r\n") !== false) {
             $response = str_ireplace("HTTP/1.0 200 Connection established\r\n\r\n", '', $response);
         }
         if (stripos($response, "HTTP/1.1 200 Connection established\r\n\r\n") !== false) {
             $response = str_ireplace("HTTP/1.1 200 Connection established\r\n\r\n", '', $response);
         }
     }
     if (stripos($response, "HTTP/1.1 100 Continue\r\n\r\n") !== false) {
         $response = str_ireplace("HTTP/1.1 100 Continue\r\n\r\n", '', $response);
     }
     // Split headers and body:
     list($headers, $body) = explode("\r\n\r\n", $response, 2);
     // Explode headers
     $headers = explode("\r\n", $headers);
     return $this->handleResult($request, $headers, $body);
 }
Esempio n. 4
0
 public function send(Request\Request $request)
 {
     if (!$request->isSigned()) {
         $request->sign();
     }
     $curl = curl_init($this->getBaseUrl());
     curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
     curl_setopt($curl, CURLOPT_HEADER, true);
     curl_setopt($curl, CURLOPT_POSTFIELDS, $request->getDocumentString());
     curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type' => 'text/xml; charset=UTF-8'));
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     if ($this->verification === false) {
         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
     }
     $response = curl_exec($curl);
     $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
     $headers = explode("\r\n", substr($response, 0, $header_size));
     $body = substr($response, $header_size);
     return $this->handleResult($request, $headers, $body);
 }