Current Path : /var/www/u0635749/data/www/hobbyclick.ru/hobbyclick.ru/www/catalog/ |
Current File : /var/www/u0635749/data/www/hobbyclick.ru/hobbyclick.ru/www/catalog/payment.php |
<?php require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); use Bitrix\Main, Bitrix\Main\Loader, Bitrix\Sale, Bitrix\Sale\Order, Bitrix\Sale\PaySystem, Bitrix\Sale\Payment; $request = \Bitrix\Main\Context::getCurrent()->getRequest(); Loader::includeModule("sale"); $registry = Sale\Registry::getInstance(Sale\Registry::REGISTRY_TYPE_ORDER); $orderClassName = $registry->getOrderClassName(); $order = $orderClassName::loadByAccountNumber((int) $request->get('ORDER_ID'));// id заказа if ($order->isAllowPay()) { $paymentCollection = $order->getPaymentCollection(); foreach ($paymentCollection as $payment) { $arResult["PAYMENT"][$payment->getId()] = $payment->getFieldValues(); if (intval($payment->getPaymentSystemId()) > 0 && !$payment->isPaid()) { $paySystemService = PaySystem\Manager::getObjectById($payment->getPaymentSystemId()); if (!empty($paySystemService)) { $arPaySysAction = $paySystemService->getFieldsValues(); if ($paySystemService->getField('NEW_WINDOW') === 'N' || $paySystemService->getField('ID') == PaySystem\Manager::getInnerPaySystemId()){ $initResult = $paySystemService->initiatePay($payment, null, PaySystem\BaseServiceHandler::STRING); if ($initResult->isSuccess()) $arPaySysAction['BUFFERED_OUTPUT'] = $initResult->getTemplate(); // получаем форму оплаты из обработчика else $arPaySysAction["ERROR"] = $initResult->getErrorMessages(); } } } } } echo $arPaySysAction['BUFFERED_OUTPUT']; if (!$_GET['SUCCESS'] && $arPaySysAction['BUFFERED_OUTPUT']){ } else { $dbBasketItems = CSaleBasket::GetList( array( "NAME" => "ASC", "ID" => "ASC" ), array( "ORDER_ID" => $_REQUEST['ORDER_ID'] ), false, false, array("ID", "PRODUCT_ID") ); if ($arItems = $dbBasketItems->Fetch()) { $PRODUCT_ID = $arItems['PRODUCT_ID']; } $dbOrderProps = CSaleOrderPropsValue::GetList( array("SORT" => "ASC"), array("ORDER_ID" => $_REQUEST['ORDER_ID'], "CODE"=>array("DAY_TIME")) ); while ($arOrderProps = $dbOrderProps->GetNext()): $date = $arOrderProps['VALUE']; endwhile; $APPLICATION->IncludeComponent( "meven:schedule", "", array( 'DATENOW' => $date, "ELEMENT" => $PRODUCT_ID, "IBLOCK" => OFFER_IBLOCK_ID ), false ); }?> <script> $.fancybox.open($('.fancybox-content'), { touch: false }) $('.tab-pane').removeClass('show active '); $('#step4').addClass('show active '); </script> <? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>