Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
manager.php
1
<?php
2
3
namespace
Bitrix\Sale\Services\PaySystem\Restrictions
;
4
5
use
Bitrix\Sale\Payment
;
6
use
Bitrix\Sale\Services\Base
;
7
8
class
Manager
extends
Base\RestrictionManager
9
{
10
protected
static
$classNames
=
null
;
11
15
public
static
function
getEventName
()
16
{
17
return
'onSalePaySystemRestrictionsClassNamesBuildList'
;
18
}
19
23
protected
static
function
getBuildInRestrictions
()
24
{
25
return
array(
26
'\Bitrix\Sale\Services\PaySystem\Restrictions\PersonType'
=>
'lib/services/paysystem/restrictions/persontype.php'
,
27
'\Bitrix\Sale\Services\PaySystem\Restrictions\Price'
=>
'lib/services/paysystem/restrictions/price.php'
,
28
'\Bitrix\Sale\Services\PaySystem\Restrictions\PercentPrice'
=>
'lib/services/paysystem/restrictions/percentprice.php'
,
29
'\Bitrix\Sale\Services\PaySystem\Restrictions\Currency'
=>
'lib/services/paysystem/restrictions/currency.php'
,
30
'\Bitrix\Sale\Services\PaySystem\Restrictions\Delivery'
=>
'lib/services/paysystem/restrictions/delivery.php'
,
31
'\Bitrix\Sale\Services\PaySystem\Restrictions\Site'
=>
'lib/services/paysystem/restrictions/site.php'
,
32
'\Bitrix\Sale\Services\PaySystem\Restrictions\TradeBinding'
=>
'lib/services/paysystem/restrictions/tradebinding.php'
,
33
'\Bitrix\Sale\Services\PaySystem\Restrictions\ProductCategory'
=>
'lib/services/paysystem/restrictions/productcategory.php'
,
34
'\Bitrix\Sale\Services\PaySystem\Restrictions\ConcreteProduct'
=>
'lib/services/paysystem/restrictions/concreteproduct.php'
,
35
);
36
}
37
41
protected
static
function
getServiceType
()
42
{
43
return
parent::SERVICE_TYPE_PAYMENT;
44
}
45
46
public
static
function
getPriceRange
(
Payment
$payment, $paySystemId)
47
{
48
$result = array();
49
50
$classes = array(
51
'\Bitrix\Sale\Services\PaySystem\Restrictions\PercentPrice'
,
52
'\Bitrix\Sale\Services\PaySystem\Restrictions\Price'
53
);
54
55
$params = array(
56
'select'
=> array(
'CLASS_NAME'
,
'PARAMS'
),
57
'filter'
=> array(
58
'SERVICE_ID'
=> $paySystemId,
59
'=CLASS_NAME'
=> $classes
60
)
61
);
62
63
$dbRes =
Manager::getList
($params);
64
while
($data = $dbRes->fetch())
65
{
66
$range = $data[
'CLASS_NAME'
]::getRange($payment, $data[
'PARAMS'
]);
67
68
if
(!$result[
'MAX'
] || $range[
'MAX'
] < $result[
'MAX'
])
69
$result[
'MAX'
] = $range[
'MAX'
];
70
71
if
(!$result[
'MIN'
] || $range[
'MIN'
] > $result[
'MIN'
])
72
$result[
'MIN'
] = $range[
'MIN'
];
73
}
74
75
return
$result;
76
}
77
}
Bitrix\Sale\Cashbox\Manager
Definition
manager.php:22
Bitrix\Sale\Cashbox\Manager\getList
static getList(array $parameters=[])
Definition
manager.php:135
Bitrix\Sale\Payment
Definition
payment.php:19
Bitrix\Sale\Services\PaySystem\Restrictions\Manager\getServiceType
static getServiceType()
Definition
manager.php:41
Bitrix\Sale\Services\PaySystem\Restrictions\Manager\getBuildInRestrictions
static getBuildInRestrictions()
Definition
manager.php:23
Bitrix\Sale\Services\PaySystem\Restrictions\Manager\getPriceRange
static getPriceRange(Payment $payment, $paySystemId)
Definition
manager.php:46
Bitrix\Sale\Services\PaySystem\Restrictions\Manager\getEventName
static getEventName()
Definition
manager.php:15
Bitrix\Sale\Services\PaySystem\Restrictions\Manager\$classNames
static $classNames
Definition
manager.php:10
Bitrix\Sale\Services\Base
Definition
concreteproductrestriction.php:3
Bitrix\Sale\Services\PaySystem\Restrictions
Definition
concreteproduct.php:3
modules
sale
lib
services
paysystem
restrictions
manager.php
Создано системой
1.10.0