Example #1
1
 protected static function getPaymentsInfo(Order $order)
 {
     $payments = $order->getPaymentCollection();
     if (!$payments) {
         return array();
     }
     $result = array();
     /** @var $payment \Bitrix\Sale\Payment  */
     foreach ($payments as $payment) {
         $id = $payment->getField("PAY_SYSTEM_ID");
         $ptId = $order->getPersonTypeId();
         if (!$id || !$ptId) {
             continue;
         }
         $params = OrderPayment::getPaySystemParams($id, $ptId);
         if (!$params) {
             continue;
         }
         $result[] = array("ID" => $payment->getId(), "NAME" => $params["NAME"], "LOGOTIP_PATH" => $params["LOGOTIP_PATH"], "IS_PAYED" => $payment->isPaid());
     }
     return $result;
 }
Example #2
0
                if (!$shipment->isSystem()) {
                    echo Admin\Blocks\OrderShipment::getView($shipment, $index++);
                }
            }
            echo Admin\Blocks\OrderShipment::createNewShipmentButton();
            break;
        case "financeinfo":
            echo Admin\Blocks\OrderFinanceInfo::getView($saleOrder, false);
            break;
        case "payment":
            $payments = $saleOrder->getPaymentCollection();
            $index = 0;
            foreach ($payments as $payment) {
                echo Admin\Blocks\OrderPayment::getView($payment, $index++);
            }
            echo Admin\Blocks\OrderPayment::createButtonAddPayment('view');
            break;
        case "additional":
            echo Admin\Blocks\OrderAdditional::getView($saleOrder, $formId . "_form");
            break;
        case "basket":
            echo $orderBasket->getView();
            echo '<div style="display: none;">' . $orderBasket->settingsDialog->getHtml() . '</div>';
            break;
    }
    $tabControl->DraggableBlockEnd();
}
?>
	</div>
</td></tr>
Example #3
0
 protected function updatePaySystemInfoAction()
 {
     if ($this->request["orderId"]) {
         $orderId = $this->request["orderId"];
     } else {
         throw new UserMessageException("Incorrect order ID!");
     }
     if ($this->request["paymentId"]) {
         $paymentId = $this->request["paymentId"];
     } else {
         throw new UserMessageException("Incorrect payment ID!");
     }
     /** @var \Bitrix\Sale\Order $order */
     $order = Sale\Order::load($orderId);
     if ($order) {
         /** @var \Bitrix\Sale\PaymentCollection $paymentCollection */
         $paymentCollection = $order->getPaymentCollection();
         /** @var \Bitrix\Sale\Payment $payment */
         $payment = $paymentCollection->getItemById($paymentId);
         if ($payment) {
             $psResultFile = '';
             $psParams = Admin\Blocks\OrderPayment::getPaySystemParams($payment->getPaymentSystemId(), $order->getPersonTypeId());
             $psActionPath = $_SERVER["DOCUMENT_ROOT"] . $psParams["ACTION_FILE"];
             $psActionPath = str_replace("\\", "/", $psActionPath);
             while (substr($psActionPath, strlen($psActionPath) - 1, 1) == "/") {
                 $psActionPath = substr($psActionPath, 0, strlen($psActionPath) - 1);
             }
             if (file_exists($psActionPath) && is_dir($psActionPath)) {
                 if (file_exists($psActionPath . "/result.php") && is_file($psActionPath . "/result.php")) {
                     $psResultFile = $psActionPath . "/result.php";
                 }
             } elseif (strlen($psParams["RESULT_FILE"]) > 0) {
                 if (file_exists($_SERVER["DOCUMENT_ROOT"] . $psParams["RESULT_FILE"]) && is_file($_SERVER["DOCUMENT_ROOT"] . $psParams["RESULT_FILE"])) {
                     $psResultFile = $_SERVER["DOCUMENT_ROOT"] . $psParams["RESULT_FILE"];
                 }
             }
             if (strlen($psResultFile) > 0) {
                 \CSalePaySystemAction::InitParamArrays($order->getFieldValues(), $orderId, $psParams["PARAMS"], array(), $payment->getFieldValues());
                 try {
                     if (!(include $psResultFile)) {
                         $this->addResultError(GetMessage("SALE_OA_ERROR_PAY_SYSTEM_INFO"));
                     }
                 } catch (SystemException $e) {
                     $this->addResultError($e->getMessage());
                 }
             }
         }
     }
 }
Example #4
0
            break;
        case "delivery":
            $shipments = $order->getShipmentCollection();
            $index = 0;
            /** @var \Bitrix\Sale\Shipment  $shipment*/
            foreach ($shipments as $shipment) {
                if (!$shipment->isSystem()) {
                    echo Blocks\OrderShipment::getView($shipment, ++$index, 'edit');
                }
            }
            break;
        case "payment":
            $payments = $order->getPaymentCollection();
            $index = 0;
            foreach ($payments as $payment) {
                echo Blocks\OrderPayment::getView($payment, ++$index, 'edit');
            }
            break;
        case "additional":
            echo Blocks\OrderAdditional::getEdit($order, $formId . "_form", 'ORDER');
            break;
        case "basket":
            echo $orderBasket->getEdit();
            echo '<div style="display: none;">' . $orderBasket->settingsDialog->getHtml() . '</div>';
            break;
    }
    $tabControl->DraggableBlockEnd();
}
?>
	</div>
</td></tr>
Example #5
0
         foreach ($shipments as $shipment) {
             if (!$shipment->isSystem()) {
                 echo Blocks\OrderShipment::getEdit($shipment, 0, '', $_POST['SHIPMENT'][1]);
             }
         }
         break;
     case "payment":
         $payments = $order->getPaymentCollection();
         if (count($payments) == 0) {
             $order->getPaymentCollection()->createItem();
         }
         $index = 0;
         foreach ($payments as $payment) {
             echo Blocks\OrderPayment::getEdit($payment, ++$index, $_POST['PAYMENT'][$index]);
         }
         echo Blocks\OrderPayment::createButtonAddPayment('edit');
         break;
     case 'relprops':
         echo Blocks\OrderBuyer::getPropsEdit($order);
         break;
     case "financeinfo":
         echo Blocks\OrderFinanceInfo::getView($order);
         break;
     case "additional":
         echo Blocks\OrderAdditional::getEdit($order, $formId . "_form", 'ORDER');
         break;
     case "statusorder":
         echo Blocks\OrderStatus::getEditSimple($USER->GetID(), 'STATUS_ID', \Bitrix\Sale\OrderStatus::getInitialStatus());
         break;
 }
 $tabControl->DraggableBlockEnd();
<tr>
	<td>
		<div style="position: relative; vertical-align: top">
			<?php 
$tabControl->DraggableBlocksStart();
?>
			<?php 
foreach ($blocksOrder as $blockCode) {
    $tabControl->DraggableBlockBegin(GetMessage("SALE_BLOCK_TITLE_" . toUpper($blockCode)), $blockCode);
    switch ($blockCode) {
        case "financeinfo":
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderFinanceInfo::getView($saleOrder, $new);
            break;
        case "payment":
            $index = 1;
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderPayment::getEdit($payment, $index, $_POST['PAYMENT'][$index]);
            break;
        case "buyer":
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderBuyer::getView($saleOrder);
            break;
        case "additional":
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderAdditional::getEdit($payment, $tableId . "_form", 'PAYMENT[1]');
            break;
        case "statusorder":
            echo \Bitrix\Sale\Helpers\Admin\Blocks\OrderStatus::getEditSimple($USER->GetID(), 'PAYMENT[1][ORDER_STATUS_ID]', $saleOrder->getField('STATUS_ID'));
            break;
    }
    $tabControl->DraggableBlockEnd();
}
?>
		</div>