• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/repository/paymentrepository.php
  • Класс: BitrixSaleRepositoryPaymentRepository
  • Вызов: PaymentRepository::getByRow
private function getByRow(array $paymentRow): ?SalePayment
{
	$orderClassName = SaleRegistry::getInstance(SaleRegistry::REGISTRY_TYPE_ORDER)->getOrderClassName();

	/** @var SaleOrder $orderClassName */
	$order = $orderClassName::load($paymentRow['ORDER_ID']);
	if ($order === null)
	{
		return null;
	}

	$paymentId = (int)$paymentRow['ID'];
	if ($paymentId > 0)
	{
		/** @var SalePayment $payment */
		$payment = $order->getPaymentCollection()->getItemById($paymentRow['ID']);

		return $payment;
	}

	return null;
}