1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
caller.php
См. документацию.
1<?php
2
4
9
10class Caller
11{
12 protected $http;
13 protected $apiUrl;
14
15 public function __construct($params)
16 {
17 $this->http = new HttpClient(array(
18 "version" => "1.1",
19 "socketTimeout" => 60,
20 "streamTimeout" => 60,
21 "redirect" => true,
22 "redirectMax" => 5,
23 ));
24
25 if(!isset($params["COMPATIBILITY-LEVEL"]))
26 $params["COMPATIBILITY-LEVEL"] = 945;
27
28 if(!isset($params["EBAY_SITE_ID"]))
29 $params["EBAY_SITE_ID"] = 215; //RU
30
31 if(!isset($params["URL"]))
32 throw new ArgumentNullException("params[\"URL\"]");
33
34 $this->apiUrl = $params["URL"];
35 $this->http->setHeader("X-EBAY-API-COMPATIBILITY-LEVEL", $params["COMPATIBILITY-LEVEL"]);
36 $this->http->setHeader("X-EBAY-API-SITEID", $params["EBAY_SITE_ID"]);
37 $this->http->setHeader("Content-Type", "text/xml");
38 }
39
40 public function sendRequest($callName, $data, $devId = "", $apiAppId = "", $certId = "")
41 {
42 if($callName == '')
43 throw new ArgumentNullException("callName");
44
45 $this->http->setHeader("X-EBAY-API-CALL-NAME", $callName);
46
47 if($devId <> '')
48 $this->http->setHeader("X-EBAY-API-DEV-NAME", $devId);
49
50 if($apiAppId <> '')
51 $this->http->setHeader("X-EBAY-API-APP-NAME", $apiAppId);
52
53 if($certId <> '')
54 $this->http->setHeader("X-EBAY-API-CERT-NAME", $certId);
55
56 $result = @$this->http->post($this->apiUrl, $data);
57 $errors = $this->http->getError();
58
59 if (!$result && !empty($errors))
60 {
61 $strError = "";
62
63 foreach($errors as $errorCode => $errMes)
64 $strError .= $errorCode.": ".$errMes;
65
66 throw new SystemException($strError);
67 }
68 else
69 {
70 $status = $this->http->getStatus();
71
72 if ($status != 200)
73 throw new SystemException(sprintf('HTTP error code: %d', $status));
74 }
75
76 return $result;
77 }
78}
sendRequest($callName, $data, $devId="", $apiAppId="", $certId="")
Определения caller.php:40
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
<? if( $useEditor3):?>< tr class="heading">< td colspan="2"><? echo GetMessage("FILEMAN_OPTION_SPELL_SET");?></td ></tr ><? if(function_exists( 'pspell_config_create')):$use_pspell_checked=(COption::GetOptionString( $module_id, "use_pspell", "Y")=="Y") ? "checked" :"";?>< tr >< td valign="top">< label for="use_pspell"><?echo GetMessage("FILEMAN_OPTION_USE_PSPELL");?></label >< br >< a title="<?echo GetMessage("FILEMAN_OPTION_ADDISH_DICS_TITLE");?> http
Определения options.php:1473
$result
Определения get_property_values.php:14
$errors
Определения iblock_catalog_edit.php:74
$strError
Определения options_user_settings.php:4
$status
Определения session.php:10
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799