1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
paysystem.php
См. документацию.
1
<?php
2
namespace
Bitrix\Sale\Cashbox\Restrictions;
3
4
use Bitrix\Main\Localization\Loc;
5
use Bitrix\Sale\Internals\Entity;
6
use Bitrix\Sale\Payment;
7
use Bitrix\Sale;
8
use Bitrix\Sale\Services\Base\Restriction;
9
10
Loc::loadMessages(__FILE__);
11
16
class
PaySystem
extends
Restriction
17
{
18
public
static
$easeSort
= 200;
19
protected
static
$preparedData
=
array
();
20
24
public
static
function
getClassTitle
()
25
{
26
return
Loc::getMessage(
"SALE_CASHBOX_RSTR_BY_PS_TITLE"
);
27
}
28
32
public
static
function
getClassDescription
()
33
{
34
return
Loc::getMessage(
"SALE_CASHBOX_RSTR_BY_PS_DESC"
);
35
}
36
43
public
static
function
check
(
$params
,
array
$restrictionParams, $serviceId = 0)
44
{
45
if
(is_array($restrictionParams) && isset($restrictionParams[
'PAY_SYSTEMS'
]))
46
{
47
$diff = array_diff(
$params
, $restrictionParams[
'PAY_SYSTEMS'
]);
48
return
empty($diff);
49
}
50
51
return
true
;
52
}
53
58
protected
static
function
extractParams(
Entity
$entity
)
59
{
60
$result
=
array
();
61
62
if
(
$entity
instanceof
Sale
\Order)
63
{
64
$collection =
$entity
->getPaymentCollection();
65
if
($collection)
66
{
68
foreach
($collection as $item)
69
$result
[] = $item->getPaymentSystemId();
70
}
71
}
72
elseif
(
$entity
instanceof
Sale
\
Shipment
)
73
{
75
$shipmentCollection =
$entity
->getCollection();
76
if
(!$shipmentCollection)
77
return
$result
;
78
79
$order
= $shipmentCollection->getOrder();
80
if
(!
$order
)
81
return
$result
;
82
83
$paymentCollection
=
$order
->getPaymentCollection();
84
if
(!
$paymentCollection
)
85
return
$result
;
86
88
foreach
(
$paymentCollection
as $item)
89
$result
[] = $item->getPaymentSystemId();
90
}
91
elseif
(
$entity
instanceof Payment)
92
{
93
$result
[] =
$entity
->getPaymentSystemId();
94
}
95
96
return
$result
;
97
}
98
102
protected
static
function
getPaySystemsList
()
103
{
104
static
$result
=
null
;
105
106
if
(
$result
!==
null
)
107
return
$result
;
108
109
$result
=
array
();
110
111
$dbResultList =
Sale\PaySystem\Manager::getList
(
array
(
112
'select'
=>
array
(
"ID"
,
"NAME"
,
"ACTIVE"
),
113
'filter'
=>
array
(
"ACTIVE"
=>
"Y"
),
114
'order'
=>
array
(
"SORT"
=>
"ASC"
,
"NAME"
=>
"ASC"
)
115
));
116
117
while
($arPayType = $dbResultList->fetch())
118
$result
[$arPayType[
"ID"
]] = $arPayType[
"NAME"
];
119
120
return
$result
;
121
}
122
127
public
static
function
getParamsStructure
(
$entityId
= 0)
128
{
129
$result
=
array
(
130
"PAY_SYSTEMS"
=>
array
(
131
"TYPE"
=>
"ENUM"
,
132
'MULTIPLE'
=>
'Y'
,
133
"LABEL"
=> Loc::getMessage(
"SALE_CASHBOX_RSTR_BY_PS"
),
134
"OPTIONS"
=> self::getPaySystemsList()
135
)
136
);
137
138
return
$result
;
139
}
140
145
public
static
function
getSeverity
($mode)
146
{
147
return
Manager::SEVERITY_STRICT
;
148
}
149
150
}
Bitrix\Sale\Cashbox\Restrictions\PaySystem\$easeSort
static $easeSort
Определения
paysystem.php:18
Bitrix\Sale\Cashbox\Restrictions\PaySystem\check
static check($params, array $restrictionParams, $serviceId=0)
Определения
paysystem.php:43
Bitrix\Sale\Cashbox\Restrictions\PaySystem\getClassTitle
static getClassTitle()
Определения
paysystem.php:24
Bitrix\Sale\Cashbox\Restrictions\PaySystem\$preparedData
static $preparedData
Определения
paysystem.php:19
Bitrix\Sale\Cashbox\Restrictions\PaySystem\getClassDescription
static getClassDescription()
Определения
paysystem.php:32
Bitrix\Sale\Cashbox\Restrictions\PaySystem\getPaySystemsList
static getPaySystemsList()
Определения
paysystem.php:102
Bitrix\Sale\Cashbox\Restrictions\PaySystem\getParamsStructure
static getParamsStructure($entityId=0)
Определения
paysystem.php:127
Bitrix\Sale\Cashbox\Restrictions\PaySystem\getSeverity
static getSeverity($mode)
Определения
paysystem.php:145
Bitrix\Sale\PaySystem\Manager\getList
static getList(array $params=array())
Определения
manager.php:84
Bitrix\Sale\Services\Base\RestrictionManager\SEVERITY_STRICT
const SEVERITY_STRICT
Определения
restrictionmanager.php:31
Bitrix\Sale\Shipment
Определения
shipment.php:21
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$entity
$entity
Определения
group_bizproc_workflow_delete.php:17
Bitrix\Catalog\Restriction
Определения
toolavailabilitymanager.php:3
Bitrix\Main\Entity
Определения
ufield.php:9
Bitrix\Sale\PaySystem
Определения
applepay.php:3
Bitrix\Sale
$order
$order
Определения
payment.php:8
$paymentCollection
$paymentCollection
Определения
payment.php:11
$entityId
$entityId
Определения
payment.php:4
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
sale
lib
cashbox
restrictions
paysystem.php
Создано системой
1.14.0