• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/ebay/api/caller.php
  • Класс: BitrixSaleTradingPlatformEbayApiCaller
  • Вызов: Caller::__construct
public function __construct($params)
{
	$this->http = new HttpClient(array(
		"version" => "1.1",
		"socketTimeout" => 60,
		"streamTimeout" => 60,
		"redirect" => true,
		"redirectMax" => 5,
	));

	if(!isset($params["COMPATIBILITY-LEVEL"]))
		$params["COMPATIBILITY-LEVEL"] = 945;

	if(!isset($params["EBAY_SITE_ID"]))
		$params["EBAY_SITE_ID"] = 215;  //RU

	if(!isset($params["URL"]))
		throw new ArgumentNullException("params["URL"]");

	$this->apiUrl = $params["URL"];
	$this->http->setHeader("X-EBAY-API-COMPATIBILITY-LEVEL", $params["COMPATIBILITY-LEVEL"]);
	$this->http->setHeader("X-EBAY-API-SITEID", $params["EBAY_SITE_ID"]);
	$this->http->setHeader("Content-Type", "text/xml");
}