3namespace Sale\Handlers\PaySystem;
6use Bitrix\Main\Request;
8use Bitrix\Sale\PaySystem;
9use Bitrix\Sale\Payment;
10use Bitrix\Sale\PriceMaths;
11use Bitrix\Sale\Internals\UserBudgetPool;
12use Bitrix\Main\Entity\EntityError;
13use Bitrix\Main\Localization\Loc;
15Loc::loadMessages(__FILE__);
27 $result =
new PaySystem\ServiceResult();
39 if (
$res->isSuccess())
42 if (!
$res->isSuccess())
72 $result =
new PaySystem\ServiceResult();
80 if ($this->isUserBudgetLock(
$order))
82 $result->addError(
new EntityError(Loc::getMessage(
'ORDER_PSH_INNER_ERROR_USER_BUDGET_LOCK')));
87 $result->setOperationType(PaySystem\ServiceResult::MONEY_LEAVING);
98 $result =
new PaySystem\ServiceResult();
101 $collection =
$payment->getCollection();
104 $order = $collection->getOrder();
106 if ($this->isUserBudgetLock(
$order))
108 $result->addError(
new EntityError(Loc::getMessage(
'ORDER_PSH_INNER_ERROR_USER_BUDGET_LOCK')));
112 $paymentSum = PriceMaths::roundPrecision(
$payment->getSum());
115 if($userBudget >= $paymentSum)
118 $result->addError(
new EntityError(Loc::getMessage(
'ORDER_PSH_INNER_ERROR_INSUFFICIENT_MONEY')));
127 public function debitNoDemand(Payment
$payment)
138 if ($userAccount = \CSaleUserAccount::GetByUserId(
$order->getUserId(),
$order->getCurrency()))
139 return $userAccount[
'LOCKED'] ==
'Y';
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
const BUDGET_TYPE_ORDER_PAY
static getUserBudgetByOrder(Sale\Order $order)
const BUDGET_TYPE_ORDER_UNPAY
static addPoolItem(Sale\Order $order, $value, $type, Sale\Payment $payment=null)
initiatePay(Payment $payment, Request $request=null)
creditNoDemand(Payment $payment)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
refund(Payment $payment, $refundableSum)