if (\Bitrix\Main\IO\File::isFileExists($documentRoot . $actionFile . "/payment.php")) { $fields["HAVE_PAYMENT"] = "Y"; } if (\Bitrix\Main\IO\File::isFileExists($documentRoot . $actionFile . "/result_rec.php")) { $fields["HAVE_RESULT_RECEIVE"] = "Y"; } } if ($request->get('TARIF') !== null) { if ($path !== null) { if (\Bitrix\Main\IO\File::isFileExists($documentRoot . $path . '/handler.php')) { require_once $documentRoot . $path . '/handler.php'; $className = PaySystem\Manager::getClassNameFromPath($actionFile); $fields["TARIF"] = $className::prepareToField($request->get('TARIF')); } } else { $fields["TARIF"] = CSalePaySystemsHelper::prepareTarifForSaving($actionFile, $request->get('TARIF')); } } $isConsumerChange = $request->get('ACTION_FILE') != $request->get('PRIOR_ACTION_FILE'); $file = $request->getFile('LOGOTIP'); if ($file !== null && $file["error"] == 0) { $imageFileError = CFile::CheckImageFile($file); if ($imageFileError === null) { $fields['LOGOTIP'] = $file; $fields['LOGOTIP']['del'] = trim($request->get("LOGOTIP_del")); $fields['LOGOTIP']['MODULE_ID'] = "sale"; CFile::SaveForDB($fields, 'LOGOTIP', 'sale/paysystem/logotip'); } else { $errorMessage .= $imageFileError . '.<br>'; } } elseif ($request->get("LOGOTIP_del") !== null && $request->get("LOGOTIP_del") == 'Y') {
} elseif ($actionID <= 0) { $logo = ""; if (file_exists($_SERVER["DOCUMENT_ROOT"] . ${"ACTION_FILE_" . $arPersonType["ID"]} . "/logo.png")) { $logo = $_SERVER["DOCUMENT_ROOT"] . ${"ACTION_FILE_" . $arPersonType["ID"]} . "/logo.png"; } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . ${"ACTION_FILE_" . $arPersonType["ID"]} . "/logo.jpg")) { $logo = $_SERVER["DOCUMENT_ROOT"] . ${"ACTION_FILE_" . $arPersonType["ID"]} . "/logo.jpg"; } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . ${"ACTION_FILE_" . $arPersonType["ID"]} . "/logo.gif")) { $logo = $_SERVER["DOCUMENT_ROOT"] . ${"ACTION_FILE_" . $arPersonType["ID"]} . "/logo.gif"; } $arPicture = CFile::MakeFileArray($logo); } $arPicture["old_file"] = $arPSAction["LOGOTIP"]; $arPicture["del"] = trim($_POST["LOGOTIP_" . $arPersonType["ID"] . "_del"]); $arFields = array("PAY_SYSTEM_ID" => $ID, "PERSON_TYPE_ID" => $arPersonType["ID"], "NAME" => ${"NAME_" . $arPersonType["ID"]}, "ACTION_FILE" => ${"ACTION_FILE_" . $arPersonType["ID"]}, "NEW_WINDOW" => ${"NEW_WINDOW_" . $arPersonType["ID"]} == "Y" ? "Y" : "N", "PARAMS" => CSalePaySystemAction::SerializeParams($arParams), "HAVE_PREPAY" => "N", "HAVE_RESULT" => "N", "HAVE_ACTION" => "N", "HAVE_PAYMENT" => "N", "HAVE_RESULT_RECEIVE" => "N", "ENCODING" => trim(${"ENCODING_" . $arPersonType["ID"]}), "LOGOTIP" => $arPicture); if (!empty($arTarif) && is_array($arTarif)) { $arFields["TARIF"] = CSalePaySystemsHelper::prepareTarifForSaving($arFields["ACTION_FILE"], $arTarif); } $pathToAction = $_SERVER["DOCUMENT_ROOT"] . ${"ACTION_FILE_" . $arPersonType["ID"]}; $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)) { if (file_exists($pathToAction . "/pre_payment.php")) { $arFields["HAVE_PREPAY"] = "Y"; } if (file_exists($pathToAction . "/result.php")) { $arFields["HAVE_RESULT"] = "Y"; } if (file_exists($pathToAction . "/action.php")) {