示例#1
0
 $arResult["HAVE_PREPAYMENT"] = true;
 CSalePaySystemAction::InitParamArrays(false, false, $arPaySysAction["PARAMS"]);
 $pathToAction = $_SERVER["DOCUMENT_ROOT"] . $arPaySysAction["ACTION_FILE"];
 $pathToAction = str_replace("\\", "/", $pathToAction);
 while (substr($pathToAction, strlen($pathToAction) - 1, 1) == "/") {
     $pathToAction = substr($pathToAction, 0, strlen($pathToAction) - 1);
 }
 if (file_exists($pathToAction)) {
     if (is_dir($pathToAction) && file_exists($pathToAction . "/pre_payment.php")) {
         $pathToAction .= "/pre_payment.php";
     }
     include_once $pathToAction;
     $psPreAction = new CSalePaySystemPrePayment();
     if ($psPreAction->init()) {
         $psPreAction->encoding = $arPaySysAction["ENCODING"];
         if ($psPreAction->IsAction()) {
             $arResult["PREPAY_ORDER_PROPS"] = $psPreAction->getProps();
             if (IntVal($arUserResult["PAY_SYSTEM_ID"]) <= 0) {
                 $arUserResult["PERSON_TYPE_ID"] = $arResult["PREPAY_PS"]["PERSON_TYPE_ID"];
             }
             $arUserResult["PREPAYMENT_MODE"] = true;
             $arUserResult["PAY_SYSTEM_ID"] = $arResult["PREPAY_PS"]["PAY_SYSTEM_ID"];
         } elseif ($_POST["PAY_SYSTEM_ID"] == $arResult["PREPAY_PS"]["PAY_SYSTEM_ID"]) {
             $orderData = array("PATH_TO_ORDER" => $APPLICATION->GetCurPage(), "AMOUNT" => $arResult["ORDER_PRICE"], "ORDER_REQUEST" => "Y", "BASKET_ITEMS" => $arResult["BASKET_ITEMS"]);
             $arResult["REDIRECT_URL"] = $psPreAction->BasketButtonAction($orderData);
             if (strlen($arResult["REDIRECT_URL"]) > 1) {
                 $arResult["NEED_REDIRECT"] = "Y";
             }
         }
         $arResult["PREPAY_ADIT_FIELDS"] = $psPreAction->getHiddenInputs();
     }