• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Sale/Reservation/ReservationService.php
  • Класс: Bitrix\Crm\Service\Sale\Reservation\ReservationService
  • Вызов: ReservationService::removeReservesProductsByPayment
public function removeReservesProductsByPayment(Payment $payment): Result
{
	$result = new Result();

	$strategy = $this->getStrategy();
	if ($strategy instanceof ReservePaidProductsStrategy)
	{
		$binding = $payment->getOrder()->getEntityBinding();
		if (!$binding)
		{
			$result->addError(
				new Error('Order not binded')
			);
			return $result;
		}

		$ownerTypeId = $binding->getOwnerTypeId();
		$ownerId = $binding->getOwnerId();

		$result = $strategy->removeReservesPaymentProducts($ownerTypeId, $ownerId, $payment);
		if ($result->isSuccess() && $ownerTypeId === CCrmOwnerType::Deal)
		{
			$this->synchronizeOrderReservesForDealByReservationResult($ownerId, $result);
		}
	}

	return $result;
}