• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/paysystem/compatibilityhandler.php
  • Класс: BitrixSalePaySystemCompatibilityHandler
  • Вызов: CompatibilityHandler::getPrice
public function getPrice(Payment $payment)
{
	$paySystemId = $payment->getPaymentSystemId();
	$psData = Manager::getById($paySystemId);
	$psData['PSA_ACTION_FILE'] = $psData['ACTION_FILE'];
	$psData['PSA_TARIF'] = $psData['TARIF'];

	/** @var BitrixSalePaymentCollection $collection */
	$collection = $payment->getCollection();

	/** @var BitrixsaleOrder $order */
	$order = $collection->getOrder();

	/** @var BitrixSaleShipmentCollection $shipmentCollection */
	$shipmentCollection = $order->getShipmentCollection();

	$shipment = null;

	/** @var BitrixSaleShipment $item */
	foreach ($shipmentCollection as $item)
	{
		if (!$item->isSystem())
		{
			$shipment = $item;
			break;
		}
	}

	/** @var BitrixSalePropertyValueCollection $propertyCollection */
	$propertyCollection = $order->getPropertyCollection();

	/** @var BitrixSalePropertyValue $deliveryLocation */
	$deliveryLocation = $propertyCollection->getDeliveryLocation();

	if ($shipment)
		return CSalePaySystemsHelper::getPSPrice($psData, $payment->getSum(), $shipment->getPrice(), $deliveryLocation->getValue());

	return 0;
}