• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/payment.php
  • Класс: BitrixSalePayment
  • Вызов: Payment::create
static function create(PaymentCollection $collection, SalePaySystemService $paySystem = null)
{
	$fields = [
		'DATE_BILL' => new MainTypeDateTime(),
		'SUM' => 0,
		'PAID' => 'N',
		'XML_ID' => static::generateXmlId(),
		'IS_RETURN' => static::RETURN_NONE,
		'CURRENCY' => $collection->getOrder()->getCurrency(),
		'ORDER_ID' => $collection->getOrder()->getId()
	];

	$payment = static::createPaymentObject();
	$payment->setFieldsNoDemand($fields);
	$payment->setCollection($collection);

	if ($paySystem !== null)
	{
		$payment->setPaySystemService($paySystem);
	}

	return $payment;
}