27 public function delete()
32 $result[
'PLACEMENTS'][] = [
33 'PLACEMENT'=>$registry->getPlacement(),
34 'HANDLER'=>$registry->getPlacmentHandler()
37 $result[
'PLACEMENTS'][] = [
38 'PLACEMENT'=>$neworder->getPlacement(),
39 'HANDLER'=>$neworder->getPlacmentHandler()
42 $result[
'OPTIONS'] = [
'url'=>$this->app->getAppUrl()];
44 (
new Scenarios\Connector())->
delete($result);
48 \CAgent::RemoveAgent(
'\\Bitrix\\Sale\\Exchange\\Integration\\Agent\\Statistic::modify();',
'sale');
50 static::unRegisterEvents();
58 $result[
'PLACEMENTS'][] = [
59 'PLACEMENT'=>$registry->getPlacement(),
60 'HANDLER'=>$registry->getPlacmentHandler(),
61 'GROUP_NAME'=>$registry->getGroupName(),
62 'TITLE'=>$registry->getTitle(),
65 $result[
'PLACEMENTS'][] = [
66 'PLACEMENT'=>$neworder->getPlacement(),
67 'HANDLER'=>$neworder->getPlacmentHandler(),
68 'GROUP_NAME'=>$neworder->getGroupName(),
69 'TITLE'=>$neworder->getTitle(),
72 $result[
'OPTIONS'] = [
'url'=>$this->app->getAppUrl()];
74 $result[
'PROVIDER'] = [
75 'xmlId'=>$this->app->getCode(),
76 'name'=> (string)\
Bitrix\Main\
Config\Option::get(
'main',
'site_name'),
77 'externalServerHost'=> (string)\
Bitrix\Main\
Config\Option::get(
'main',
'server_name',
81 (
new Scenarios\Connector())->
add($result);
83 \CAgent::AddAgent(
'\\Bitrix\\Sale\\Exchange\\Integration\\Agent\\Statistic::modify();',
'sale',
'N', 3600);
85 static::registerEvents();
90 $eventManager = EventManager::getInstance();
93 $eventManager->registerEventHandler(
97 '\Bitrix\Sale\Exchange\Integration\Handler',
98 'handlerCallbackOnSaleOrderSaved');
99 $eventManager->registerEventHandler(
101 "OnSaleStatusOrderChange",
103 '\Bitrix\Sale\Exchange\Integration\Timeline\Order',
105 $eventManager->registerEventHandler(
107 "OnSaleOrderCanceled",
109 '\Bitrix\Sale\Exchange\Integration\Timeline\Order',
113 $eventManager->registerEventHandler(
117 '\Bitrix\Sale\Exchange\Integration\Timeline\Payment',
121 $eventManager->registerEventHandler(
123 "OnSaleStatusShipmentChange",
125 '\Bitrix\Sale\Exchange\Integration\Timeline\Shipment',
127 $eventManager->registerEventHandler(
129 "OnShipmentAllowDelivery",
131 '\Bitrix\Sale\Exchange\Integration\Timeline\Shipment',
132 'allowDeliveryNotify');
133 $eventManager->registerEventHandler(
135 "OnShipmentDeducted",
137 '\Bitrix\Sale\Exchange\Integration\Timeline\Shipment',
145 UnRegisterModuleDependences(
149 '\Bitrix\Sale\Exchange\Integration\Handler',
150 'handlerCallbackOnSaleOrderSaved');
151 UnRegisterModuleDependences(
153 "OnSaleStatusOrderChange",
155 '\Bitrix\Sale\Exchange\Integration\Timeline\Order',
157 UnRegisterModuleDependences(
159 "OnSaleOrderCanceled",
161 '\Bitrix\Sale\Exchange\Integration\Timeline\Order',
165 UnRegisterModuleDependences(
169 '\Bitrix\Sale\Exchange\Integration\Timeline\Payment',
173 UnRegisterModuleDependences(
175 "OnSaleStatusShipmentChange",
177 '\Bitrix\Sale\Exchange\Integration\Timeline\Shipment',
179 UnRegisterModuleDependences(
181 "OnShipmentAllowDelivery",
183 '\Bitrix\Sale\Exchange\Integration\Timeline\Shipment',
184 'allowDeliveryNotify');
185 UnRegisterModuleDependences(
187 "OnShipmentDeducted",
189 '\Bitrix\Sale\Exchange\Integration\Timeline\Shipment',