You are here

public function Avatax::setDefaultCurlOptions in Drupal Commerce Connector for AvaTax 7.5

Sets the default cURL options.

1 call to Avatax::setDefaultCurlOptions()
Avatax::__construct in lib/Avatax.php
Initializes the API credential properties and cURL handle.

File

lib/Avatax.php, line 212
Defines a class for consuming the Avatax API.

Class

Avatax
Defines the Avatax class.

Code

public function setDefaultCurlOptions() {
  $headers = array();
  foreach ($this
    ->httpHeaders() as $key => $value) {
    $headers[] = "{$key}: {$value}";
  }
  curl_setopt($this->ch, CURLOPT_HEADER, FALSE);
  curl_setopt($this->ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, TRUE);
  curl_setopt($this->ch, CURLOPT_VERBOSE, FALSE);
  curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 30);
  curl_setopt($this->ch, CURLOPT_TIMEOUT, 180);
}