17 private const BX_OFD_PREFIX =
'bx_';
23 public static function getHandlerList()
25 $handlerList = self::getSystemHandlerList();
27 $event =
new Main\Event(
'sale', static::EVENT_ON_GET_CUSTOM_OFD_HANDLERS);
29 $resultList = $event->getResults();
31 if (is_array($resultList) && !empty($resultList))
33 foreach ($resultList as $eventResult)
36 if ($eventResult->getType() === Main\EventResult::SUCCESS)
38 $params = $eventResult->getParameters();
39 if (!empty($params) && is_array($params))
41 $handlerList = array_merge($handlerList, $params);
53 private static function getSystemHandlerList()
69 final public static function getCode(): string
71 $reflectionOfdClass = new \ReflectionClass(static::class);
72 $code = $reflectionOfdClass->getShortName();
73 $systemHandlers = array_keys(self::getSystemHandlerList());
74 if (in_array(
'\\' . static::class, $systemHandlers))
76 $code = self::BX_OFD_PREFIX . $code;
78 return mb_strtolower($code);
87 $handler = $cashbox->
getField(
'OFD');
88 if (class_exists($handler))
90 return new $handler($cashbox);
100 private function __construct(
Cashbox $cashbox)
102 $this->cashbox = $cashbox;
127 $queryParams = array();
130 foreach ($map as $queryKey => $checkKey)
132 if ($data[$checkKey])
133 $queryParams[] = $queryKey.
'='.$data[$checkKey];
136 if (empty($queryParams))
140 return $url.implode(
'&', $queryParams);
187 $map = $this->cashbox->getField(
'OFD_SETTINGS');
188 if (isset($map[$name]))
190 if (is_array($map[$name]))
192 if (isset($map[$name][$code]))
193 return $map[$name][$code];
static getMessage($code, $replace=null, $language=null)