1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
provideraccountpay.php
См. документацию.
1<?php
8
9namespace Bitrix\Sale;
10
11use Bitrix\Main,
12 Bitrix\Main\Loader,
13 Bitrix\Sale,
14 Bitrix\Currency,
15 Bitrix\Catalog;
16
17if (!Loader::includeModule('sale'))
18 return false;
19
25{
30 public static function GetProductData($fields)
31 {
32 $fields["CAN_BUY"] = 'Y';
33 $fields["AVAILABLE_QUANTITY"] = 100000000;
34 return $fields;
35
36 }
37
38 public static function OrderProduct($fields)
39 {
40 $fields["AVAILABLE_QUANTITY"] = 'Y';
41 return $fields;
42 }
43
44 public static function CancelProduct($fields)
45 {
46 }
47
48 public static function DeliverProduct($fields)
49 {
50 }
51
52 public static function ViewProduct($fields)
53 {
54 }
55
56 public static function RecurringOrderProduct($fields)
57 {
58 }
59
60 public static function GetStoresCount($arParams = array())
61 {
62 }
63
64 public static function GetProductStores($fields)
65 {
66 }
67
68 public static function ReserveProduct($fields)
69 {
70 $fields['QUANTITY_RESERVED'] = $fields['QUANTITY_ADD'];
71 $fields['RESULT'] = true;
72 return $fields;
73 }
74
75 public static function CheckProductBarcode($fields)
76 {
77 }
78
83 public static function DeductProduct($fields)
84 {
86 $basketItem = $fields['BASKET_ITEM'];
87 $orderId = (int)$basketItem->getField('ORDER_ID');
88 $currency = $basketItem->getField('CURRENCY');
89
90 $propertyCollection = $basketItem->getPropertyCollection();
91
92 $item = $propertyCollection->getPropertyValues();
93 $sum = (float)($item['SUM_OF_CHARGE']['VALUE']) * (float)($basketItem->getQuantity());
94
96 $basket = $basketItem->getCollection();
97 $order = $basket->getOrder();
98 $userId = $order->getUserId();
99
100 $resultUpdateUserAccount = \CSaleUserAccount::UpdateAccount($userId, ($fields["UNDO_DEDUCTION"]==='N'?$sum:-$sum), $currency, "MANUAL", $orderId, "Payment to user account");
101
102 if ($resultUpdateUserAccount)
103 {
104 $fields['RESULT'] = true;
105 }
106 else
107 {
108 return false;
109 }
110
111 return $fields;
112 }
113}
$arParams
Определения access_dialog.php:21
$sum
Определения checkout.php:6
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static ReserveProduct($fields)
Определения provideraccountpay.php:68
static GetProductData($fields)
Определения provideraccountpay.php:30
static GetProductStores($fields)
Определения provideraccountpay.php:64
static RecurringOrderProduct($fields)
Определения provideraccountpay.php:56
static OrderProduct($fields)
Определения provideraccountpay.php:38
static DeliverProduct($fields)
Определения provideraccountpay.php:48
static GetStoresCount($arParams=array())
Определения provideraccountpay.php:60
static CheckProductBarcode($fields)
Определения provideraccountpay.php:75
static CancelProduct($fields)
Определения provideraccountpay.php:44
static ViewProduct($fields)
Определения provideraccountpay.php:52
static UpdateAccount($userID, $sum, $currency, $description="", $orderID=0, $notes="", $paymentId=null)
Определения user.php:589
$orderId
Определения payment.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
static DeductProduct($arFields)
$order
Определения payment.php:8
$currency
Определения template.php:266
$fields
Определения yandex_run.php:501