Esempio n. 1
0
	protected function mark_order_as_error($order, array $data) {
		CSaleOrder::Update($order['ID'], array(
			'PS_STATUS' => 'N',
			'PS_SUM' => $data['amount'],
			'PS_CURRENCY' => $data['currency'],
			'PS_STATUS_MESSAGE' => $data['message'],
			'PS_RESPONSE_DATE' => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat('FULL', LANG))),
		));
	}
Esempio n. 2
0
 public function setPayed($value)
 {
     $value = (bool) $value ? 'Y' : 'N';
     if ($value == 'Y') {
         \CSaleOrder::PayOrder($this['ID'], 'Y');
     } else {
         $data = array('PAYED' => (bool) $value ? 'Y' : 'N', 'DATE_PAYED' => Date(\CDatabase::DateFormatToPHP(\CLang::GetDateFormat('FULL', LANG))), 'USER_ID' => $this['USER_ID']);
         return \CSaleOrder::Update($this['ID'], $data);
     }
 }
Esempio n. 3
0
	function XMLDate2Dec($date_XML, $dateFormat = "DD.MM.YYYY")
	{
		static $MonthChar2Num = Array("","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");

		if(preg_match("/(\\d+)\\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s+(\\d+)/i", $date_XML, $match))
			$timestamp = mktime(0, 0, 0, array_search(strtolower($match[2]), $MonthChar2Num), $match[1], $match[3]);
		else
			$timestamp = time();

		return  date(CDatabase::DateFormatToPHP($dateFormat), $timestamp);
	}
Esempio n. 4
0
 // Login ID
 $parms .= "&VENDOR=" . urlencode($PF_USER);
 // Vendor ID
 $parms .= "&ZIP=" . urlencode($zipcode);
 // Zip
 $parms .= "&STREET=" . urlencode($address1);
 // Address
 $parms .= "&COMMENT1=" . $ORDER_ID;
 $parms .= "&COMMENT2=" . urlencode($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT"]);
 $ret_com = "{$strExePath} {$PF_HOST} {$PF_PORT} \"{$parms}\" 30";
 putenv("PFPRO_CERT_PATH=" . $PFPRO_CERT_PATH);
 exec($ret_com, $arOutput, $ret_var);
 $strOutput = $arOutput[0];
 parse_str($strOutput, $arResult);
 if (is_array($arResult) && strlen($arResult["RESULT"]) > 0) {
     $arPaySysResult = array("PS_STATUS" => $arResult["RESULT"] == 0 ? "Y" : "N", "PS_STATUS_CODE" => $arResult["RESULT"], "PS_STATUS_DESCRIPTION" => $arResult["RESPMSG"] . " - " . $arResult["PREFPSMSG"], "PS_STATUS_MESSAGE" => $arResult["PNREF"], "PS_SUM" => $AMT, "PS_CURRENCY" => "USD", "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", SITE_ID))), "USER_CARD_TYPE" => false, "USER_CARD_NUM" => $cardnum, "USER_CARD_EXP_MONTH" => $cardexp1, "USER_CARD_EXP_YEAR" => "20" . $cardexp2, "USER_CARD_CODE" => $cvv2);
     $arResult["RESULT"] = IntVal($arResult["RESULT"]);
     if ($arResult["RESULT"] != 0) {
         if ($arResult["RESULT"] < 0) {
             $strPaySysError .= "Communication Error: [" . $arResult["RESULT"] . "] " . $arResult["RESPMSG"] . " - " . $arResult["PREFPSMSG"] . ". ";
         } elseif ($arPaySysRes_tmp["RESULT"] == 125) {
             $strPaySysError .= "Your payment is declined by Fraud Service. Please contact us to make payment" . ". ";
         } elseif ($arResult["RESULT"] == 126) {
             $strPaySysWarning .= "Your payment is under review by Fraud Service. We contact you in 48 hours to get more specific information" . ". ";
         } elseif (is_set($arErrorCodes, $arResult["RESULT"])) {
             $strPaySysError .= $arErrorCodes[$arResult["RESULT"]] . ". ";
         } else {
             $strPaySysError .= "Unknown error" . ". ";
         }
     }
 } else {
Esempio n. 5
0
// ADDITIONAL FILTERS
if ($arParams["ELEMENT_LAST_TYPE"] == "count" && $arParams["ELEMENTS_LAST_COUNT"] > 0) {
    $db_res = CIBlockElement::GetList(array("ID" => "DESC"), $arFilter, false, array("nTopCount" => $arParams["ELEMENTS_LAST_COUNT"]), array("ID"));
    $iLastID = 0;
    // WTF?
    while ($res = $db_res->Fetch()) {
        $arFilter[">=ID"] = intVal($res["ID"]);
    }
} elseif ($arParams["ELEMENT_LAST_TYPE"] == "time" && $arParams["ELEMENTS_LAST_TIME"] > 0) {
    $arFilter[">=DATE_CREATE"] = date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), time() - $arParams["ELEMENTS_LAST_TIME"] * 3600 * 24 + CTimeZone::GetOffset());
} elseif ($arParams["ELEMENT_LAST_TYPE"] == "period" && (strLen($arParams["ELEMENTS_LAST_TIME_FROM"]) > 0 || strLen($arParams["ELEMENTS_LAST_TIME_TO"]) > 0)) {
    if (strLen($arParams["ELEMENTS_LAST_TIME_FROM"]) > 0) {
        $arFilter[">=DATE_CREATE"] = date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), MakeTimeStamp($arParams["ELEMENTS_LAST_TIME_FROM"]));
    }
    if (strLen($arParams["ELEMENTS_LAST_TIME_TO"]) > 0) {
        $arFilter["<=DATE_CREATE"] = date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), MakeTimeStamp($arParams["ELEMENTS_LAST_TIME_TO"]));
    }
}
if (!empty($arParams["ELEMENT_FILTER"])) {
    $arFilter = array_merge($arParams["ELEMENT_FILTER"], $arFilter);
}
if ($arNavParams && ($arParams["ELEMENT_ID"] > 0 || $arParams["SELECTED_ELEMENT"])) {
    CModule::IncludeModule("iblock");
    $db_res = CIBlockElement::GetList($arSort, $arFilter, false, array("nElementID" => $arParams["ELEMENT_ID"]), array("ID", "NAME"));
    if ($db_res && ($res = $db_res->Fetch())) {
        $number = $res["RANK"];
        if ($arParams["PAGE_NAVIGATE"] == "next") {
            $number++;
        } elseif ($arParams["PAGE_NAVIGATE"] == "prev") {
            $number--;
        }
Esempio n. 6
0
		$arParams = getProductDataToFillBasket($productId, $quantity, $userId, $LID, $userColumns);

		$result = CUtil::PhpToJSObject(array("params" => $arParams, "type" => $type));

		CRMModeOutput($result);
	}

}//end ORDER_AJAX=Y

/*****************************************************************************/
/**************************** FORM ORDER *************************************/
/*****************************************************************************/

//date order
$str_DATE_UPDATE = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", $lang)));
$str_DATE_INSERT = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", $lang)));

if (isset($ID) && $ID > 0)
{
	if (!$arOrderOldTmp)
		LocalRedirect("sale_order.php?lang=".LANGUAGE_ID.GetFilterParams("filter_", false));

	$LID = $str_LID;
	$str_DELIVERY_ID = (isset($_POST["DELIVERY_ID"]) && strlen($_POST["DELIVERY_ID"]) > 0) ? $_POST["DELIVERY_ID"] : $str_DELIVERY_ID;
	$str_PAY_SYSTEM_ID = (isset($_POST["PAY_SYSTEM_ID"]) && intval($_POST["PAY_SYSTEM_ID"]) > 0) ? intval($_POST["PAY_SYSTEM_ID"]) : $str_PAY_SYSTEM_ID;
}

if (!isset($str_TAX_VALUE) OR $str_TAX_VALUE == "")
	$str_TAX_VALUE = 0;

if (intval($str_PERSON_TYPE_ID) <= 0)
Esempio n. 7
0
echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), $arParam["db"]["time"]);
?>
</span>)
	</label></td></tr>
	<tr><td><div class="pbar-mark-green"></div></td><td><input type="radio" name="size" id="files" value="files" onclick="CheckButtons(this);" /><input type="hidden" name="result_files" id="result_files" value="<?php 
echo $arParam["files"]["status"];
?>
" /> <label for="files"><?php 
echo GetMessage("MAIN_OPTION_SIZE_DISTR");
?>
: <span id="div_files"><?php 
echo round($arParam["files"]["size"] / 1048576, 2);
?>
</span>Mb</label>
	(<span id="div_time_files"><?php 
echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), $arParam["files"]["time"]);
?>
</span>)</td></tr></table><?
	$usedSpace = intVal(($usedSpace/$diskSpace)*100);
?><div class="pbar-outer">
		<div id="pb_db" class="pbar-inner-red<?php 
echo $arParam["db"]["status"] == "done" ? "" : "-error";
?>
" style="width:<?php 
echo intVal($arParam["db"]["size_in_per"] * 350);
?>
px; padding-left:<?php 
echo intVal($arParam["db"]["size_in_per"] * 350);
?>
px;">&nbsp;</div><div id="pb_files" class="pbar-inner-green<?php 
echo $arParam["files"]["status"] == "done" ? "" : "-error";
Esempio n. 8
0
        } else {
            $strPS_STATUS_DESCRIPTION = (IntVal($mass[1]) == 2 ? "Declined" : "Error") . ": " . $mass[4] . " (Reason Code " . $mass[3] . " / Sub " . $mass[2] . ")";
            $strPaySysError .= (IntVal($mass[1]) == 2 ? "Transaction was declined" : "Error while processing transaction") . ": " . $mass[4] . " (" . $mass[3] . "/" . $mass[2] . ")";
        }
        $strPS_STATUS_MESSAGE = "";
        if (!empty($mass[6])) {
            $strPS_STATUS_MESSAGE .= "\nAVS Result: [" . $mass[6] . "] " . $arAVSErr[$mass[6]] . ";";
        }
        if (!empty($mass[39])) {
            $strPS_STATUS_MESSAGE .= "\nCard Code Result: [" . $mass[39] . "] " . $arCVVErr[$mass[39]] . ";";
        }
        if (!empty($mass[40])) {
            $strPS_STATUS_MESSAGE .= "\nCAVV: [" . $mass[40] . "] " . $arCAVVErr[$mass[40]] . ";";
        }
        $strPS_SUM = $mass[10];
        $arPaySysResult = array("PS_STATUS" => $strPS_STATUS, "PS_STATUS_CODE" => $strPS_STATUS_CODE, "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $strPS_SUM, "PS_CURRENCY" => $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", SITE_ID))), "USER_CARD_TYPE" => false, "USER_CARD_NUM" => $INPUT_CARD_NUM, "USER_CARD_EXP_MONTH" => $INPUT_CARD_EXP_MONTH, "USER_CARD_EXP_YEAR" => $INPUT_CARD_EXP_YEAR, "USER_CARD_CODE" => $INPUT_CARD_CODE);
    }
} else {
    ?>
	<table border="0" cellpadding="3" cellspacing="0" width="100%">
		<tr>
			<td align="right" width="40%" class="tablebody">
				<font class="tablebodytext">
				<?php 
    echo GetMessage("AN_CC");
    ?>
				</font>
			</td>
			<td class="tablebody" width="60%">
				<input type="text" class="inputtext" name="ccard_num" size="30" value="<?php 
    echo htmlspecialcharsbx($_REQUEST["ccard_num"]);
Esempio n. 9
0
']['size'] = '<?php 
        echo $res['size'];
        ?>
';
	window.parent.window.result['<?php 
        echo CUtil::JSEscape($_REQUEST["name"]);
        ?>
']['status'] = '<?php 
        echo substr($res['status'], 0, 1);
        ?>
';
	window.parent.window.result['<?php 
        echo CUtil::JSEscape($_REQUEST["name"]);
        ?>
']['time'] = '<?php 
        echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), $res["time"]);
        ?>
';
	
	window.parent.window.result['stop'] = <?php 
        echo $res["status"] == "continue" ? "false" : "true";
        ?>
;
	window.parent.window.result['error'] = false;
	
	window.parent.window.onStepDone('<?php 
        echo CUtil::JSEscape($_REQUEST["name"]);
        ?>
');
<?php 
    }
Esempio n. 10
0
$sHost = "payments.paysecure.ru";
$sUrl = "/orderstate/orderstate.cfm";
$dtm = AddToTimeStamp(array("MM" => -1), false);
$sVars = "Ordernumber=" . $ORDER_ID . "&Merchant_ID=" . $assist_Shop_IDP . "&login="******"&password="******"&FORMAT=3&StartYear=" . date('Y', $dtm) . "&StartMonth=" . date('n', $dtm) . "&StartYDay=" . date('j', $dtm) . "";
$aDesc = array("In Process" => array(GetMessage("SASP_IP"), GetMessage("SASPD_IP")), "Delayed" => array(GetMessage("SASP_D"), GetMessage("SASPD_D")), "Approved" => array(GetMessage("SASP_A"), GetMessage("SASPD_A")), "PartialApproved" => array(GetMessage("SASP_PA"), GetMessage("SASPD_PA")), "PartialDelayed" => array(GetMessage("SASP_PD"), GetMessage("SASPD_PD")), "Canceled" => array(GetMessage("SASP_C"), GetMessage("SASPD_C")), "PartialCanceled" => array(GetMessage("SASP_PC"), GetMessage("SASPD_PC")), "Declined" => array(GetMessage("SASP_DEC"), GetMessage("SASPD_DEC")), "Timeout" => array(GetMessage("SASP_T"), GetMessage("SASPD_T")));
$sResult = QueryGetData($sHost, 80, $sUrl, $sVars, $errno, $errstr, "POST");
if ($sResult != "") {
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/xml.php";
    $objXML = new CDataXML();
    $objXML->LoadString($sResult);
    $arResult = $objXML->GetArray();
    if (count($arResult) > 0 && $arResult["result"]["@"]["firstcode"] == "0") {
        $aRes = $arResult["result"]["#"]["order"][0]["#"];
        if (IntVal($aRes["ordernumber"][0]["#"]) == $ORDER_ID) {
            $arFields = array();
            $check = ToUpper(md5(toUpper(md5($password) . md5($assist_Shop_IDP . $aRes["ordernumber"][0]["#"] . $aRes["orderamount"][0]["#"] . $aRes["ordercurrency"][0]["#"] . $aRes["orderstate"][0]["#"]))));
            if ($aRes["checkvalue"][0]["#"] == $check) {
                $arOrder = CSaleOrder::GetByID($ORDER_ID);
                $arFields = array("PS_STATUS" => $aRes["orderstate"][0]["#"] == "Approved" ? "Y" : "N", "PS_STATUS_CODE" => substr($aRes["orderstate"][0]["#"], 0, 5), "PS_STATUS_DESCRIPTION" => $aDesc[$aRes["orderstate"][0]["#"]][0], "PS_STATUS_MESSAGE" => $aDesc[$aRes["orderstate"][0]["#"]][1], "PS_SUM" => DoubleVal($aRes["orderamount"][0]["#"]), "PS_CURRENCY" => $aRes["ordercurrency"][0]["#"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
                if ($arOrder["PAYED"] != "Y" && CSalePaySystemAction::GetParamValue("AUTOPAY") == "Y" && $arFields["PS_STATUS"] == "Y" && Doubleval($arOrder["PRICE"]) == DoubleVal($arFields["PS_SUM"])) {
                    CSaleOrder::PayOrder($arOrder["ID"], "Y");
                }
            }
            if (!empty($arFields)) {
                CSaleOrder::Update($ORDER_ID, $arFields);
            }
            return true;
        }
    }
}
return false;
Esempio n. 11
0
}
$bUserCanViewOrder = CSaleOrder::CanUserViewOrder($ID, $GLOBALS["USER"]->GetUserGroupArray(), $GLOBALS["USER"]->GetID());
$bUserCanEditOrder = CSaleOrder::CanUserUpdateOrder($ID, $GLOBALS["USER"]->GetUserGroupArray());
$bUserCanCancelOrder = CSaleOrder::CanUserCancelOrder($ID, $GLOBALS["USER"]->GetUserGroupArray(), $GLOBALS["USER"]->GetID());
$bUserCanPayOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "P", $GLOBALS["USER"]->GetUserGroupArray());
$bUserCanDeliverOrder = CSaleOrder::CanUserChangeOrderFlag($ID, "D", $GLOBALS["USER"]->GetUserGroupArray());
$bUserCanDeleteOrder = CSaleOrder::CanUserDeleteOrder($ID, $GLOBALS["USER"]->GetUserGroupArray(), $GLOBALS["USER"]->GetID());
$simpleForm = COption::GetOptionString("sale", "lock_catalog", "Y");
$bSimpleForm = $simpleForm == "Y" ? True : False;
if ($action == "update" && $saleModulePermissions >= "U" && $_SERVER["REQUEST_METHOD"] == "POST" && check_bitrix_sessid() && $bUserCanEditOrder && $PARTIAL_SUBMIT != "Y" && empty($dontsave)) {
    // *****************************************************************
    // *****  Preparing  ***********************************************
    // *****************************************************************
    $bTrabsactionStarted = False;
    // Order params
    $currentDate = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)));
    $dbOrderTmp = CSaleOrder::GetList(array(), array("ID" => $ID));
    //GetByID($ID);
    $arOrder = $dbOrderTmp->Fetch();
    if (!$arOrder) {
        $errorMessage .= GetMessage("SOE_NO_ORDER") . ". ";
    }
    if (CSaleOrder::IsLocked($ID, $lockedBY, $dateLock)) {
        $errorMessage .= str_replace("#DATE#", "{$dateLock}", str_replace("#ID#", "{$lockedBY}", GetMessage("SOE_ORDER_LOCKED"))) . ". ";
    }
    if (!$customTabber->Check()) {
        if ($ex = $APPLICATION->GetException()) {
            $errorMessage .= $ex->GetString();
        } else {
            $errorMessage .= "Error. ";
        }
Esempio n. 12
0
function tasksFormatDate($in_date)
{
    $date = $in_date;
    $strDate = false;
    if (!is_int($in_date)) {
        $date = MakeTimeStamp($in_date);
    }
    if ($date === false || $date === -1 || $date === 0) {
        $date = MakeTimeStamp($in_date);
    }
    // It can be other date on server (relative to client), ...
    $bTzWasDisabled = !CTimeZone::enabled();
    if ($bTzWasDisabled) {
        CTimeZone::enable();
    }
    $ts = time() + CTimeZone::getOffset();
    // ... so shift cur timestamp to compensate it.
    if ($bTzWasDisabled) {
        CTimeZone::disable();
    }
    $curDateStrAtClient = date('d.m.Y', $ts);
    $yesterdayDateStrAtClient = date('d.m.Y', strtotime('-1 day', $ts));
    if ($curDateStrAtClient === date('d.m.Y', $date)) {
        $strDate = FormatDate("today", $date);
    } elseif ($yesterdayDateStrAtClient === date('d.m.Y', $date)) {
        $strDate = FormatDate("yesterday", $date);
    } else {
        if (defined('FORMAT_DATE')) {
            $strDate = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATE), $date);
        } else {
            $strDate = FormatDate("d.m.Y", $date);
        }
    }
    return $strDate;
}
Esempio n. 13
0
</table>
<br>

<!-- Покажем список пользователей, которые сейчас на сайте -->
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumborder"><tr><td>
<table border="0" cellpadding="1" cellspacing="1" width="100%">
	<tr class="forumhead">
		<td valign="top" class="forumtitletext">
			Сейчас на форуме пользователи
		</td>
	</tr>
	<tr class="forumbody">
		<td valign="top" class="forumbodytext">
		<?php 
    $boundary_time = 10 * 60;
    $boundary_date = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)), time() - $boundary_time);
    $db_cur_users = CForumUser::GetList(array("LAST_VISIT" => "DESC"), array(">=LAST_VISIT" => $boundary_date, "HIDE_FROM_ONLINE" => "N"));
    $b_need_comma = False;
    while ($ar_cur_users = $db_cur_users->Fetch()) {
        if ($b_need_comma) {
            echo ", ";
        }
        $str_cur_name = "";
        if ($ar_cur_users["SHOW_NAME"] == "Y") {
            $str_cur_name = Trim($ar_cur_users["NAME"]);
            if (strlen($ar_cur_users["LAST_NAME"]) > 0) {
                if (strlen($str_cur_name) > 0) {
                    $str_cur_name .= " ";
                }
                $str_cur_name .= Trim($ar_cur_users["LAST_NAME"]);
            }
Esempio n. 14
0
        }
    }
    $arDirContent_t = array_merge($arDirs, $arFiles);
    $arDirContent = array();
    for ($i = 0, $l = count($arDirContent_t); $i < $l; $i++) {
        $Elem = $arDirContent_t[$i];
        $arPath = array($site, $Elem['ABS_PATH']);
        if ($Elem["TYPE"] == "F" && !$USER->CanDoFileOperation('fm_view_file', $arPath) || $Elem["TYPE"] == "D" && !$USER->CanDoFileOperation('fm_view_listing', $arPath) || $Elem["TYPE"] == "F" && $Elem["NAME"] == ".section.php") {
            continue;
        }
        $arDirContent[] = $Elem;
    }
    unset($arDirContent_t);
} else {
    $arDirContent = array();
    $date_format = CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL"));
    //CUtil::JSPostUnescape(); http://jabber.bx/view.php?id=32552
    if (isset($_POST['sres']) && CFilemanSearch::CheckSearchSess($searchSess)) {
        $searchRes = CFilemanSearch::SetSearchResult($_POST['sres'], $searchSess);
    } else {
        $searchRes = CFilemanSearch::GetSearchResult($searchSess, array($by, $order));
    }
    for ($i = 0, $l = count($searchRes); $i < $l; $i++) {
        $elPath = $searchRes[$i]['path'];
        $fullPath = $_SERVER["DOCUMENT_ROOT"] . $elPath;
        $bIsDir = $io->DirectoryExists($fullPath);
        $arPerm = $APPLICATION->GetFileAccessPermission(array($site, $elPath), $USER->GetUserGroupArray(), true);
        $arEl = array("PATH" => $fullPath, "ABS_PATH" => $elPath, "NAME" => CFileman::GetFileName($elPath), "PERMISSION" => $arPerm[0], "TIMESTAMP" => $searchRes[$i]['time'], "DATE" => date($date_format, $searchRes[$i]['time']), "SIZE" => $bIsDir ? 0 : $searchRes[$i]['size'], "TYPE" => $bIsDir ? "D" : "F");
        if (count($arPerm[1]) > 0) {
            $arEl["PERMISSION_EX"] = $arPerm[1];
        }
Esempio n. 15
0
 public static function CleanUp($period = 48)
 {
     global $DB;
     $period = intVal($period) * 3600;
     $date = $DB->CharToDateFunction($DB->ForSql(Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANGUAGE_ID)), time() - $period)), "FULL");
     $strSQL = "DELETE FROM b_forum_stat\n\t\t\t\t\tWHERE (LAST_VISIT\n\t\t\t\t\t< " . $date . ")";
     $DB->Query($strSQL, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     return "CForumStat::CleanUp();";
 }
Esempio n. 16
0
        $paymentAmount = trim($_POST["paymentAmount"]);
        $paymentCurrency = trim($_POST["paymentCurrency"]);
        if ($eshopId == $eshopIdB) {
            $checkB = md5($eshopId . "::" . $orderId . "::" . $serviceName . "::" . $eshopAccount . "::" . $recipientAmount . "::" . $recipientCurrency . "::" . $paymentStatus . "::" . $userName . "::" . $userEmail . "::" . $paymentData . "::" . $secretKeyB);
            if ($checkB == $hash) {
                if ($paymentStatus == 5) {
                    if ($recipientAmountB == $recipientAmount && $recipientCurrencyB == $recipientCurrency) {
                        if ($arOrder["PAYED"] != "Y") {
                            CSaleOrder::PayOrder($arOrder["ID"], "Y");
                        }
                    } else {
                        $techMessage = GetMessage("SALE_RBK_REC_SUMM");
                    }
                } elseif ($paymentStatus == 3) {
                    $techMessage = GetMessage("SALE_RBK_PROCESS_PAY");
                } else {
                    $techMessage = GetMessage("SALE_RBK_REC_TRANS");
                }
            } else {
                $techMessage = GetMessage("SALE_RBK_REC_SIGN");
            }
        } else {
            $techMessage = GetMessage("SALE_RBK_REC_PRODUCT");
        }
        $strPS_STATUS_DESCRIPTION = "customer - " . $userName . " (" . $userEmail . "); ";
        $strPS_STATUS_DESCRIPTION .= "paymentId - " . $paymentId . "; ";
        $strPS_STATUS_DESCRIPTION .= "date - " . $paymentData . ";";
        $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => $paymentStatus, "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $techMessage, "PS_SUM" => $recipientAmount, "PS_CURRENCY" => $recipientCurrency, "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
        CSaleOrder::Update($arOrder["ID"], $arFields);
    }
}
Esempio n. 17
0
    die;
}
$this->setFramemode(false);
if (!CModule::IncludeModule("sale")) {
    ShowError(GetMessage("SALE_MODULE_NOT_INSTALL"));
    return;
}
if (!CBXFeatures::IsFeatureEnabled('SaleAccounts')) {
    return;
}
if (!$USER->IsAuthorized()) {
    $APPLICATION->AuthForm(GetMessage("SALE_ACCESS_DENIED"), false, false, 'N', false);
}
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y";
if ($arParams["SET_TITLE"] == 'Y') {
    $APPLICATION->SetTitle(GetMessage("SPA_TITLE"));
}
$dbAccountList = CSaleUserAccount::GetList(array("CURRENCY" => "ASC"), array("USER_ID" => IntVal($USER->GetID())), false, false, array("ID", "CURRENT_BUDGET", "CURRENCY", "TIMESTAMP_X"));
if ($arAccountList = $dbAccountList->GetNext()) {
    $arResultTmp = array();
    $arResult["DATE"] = str_replace("#DATE#", date(CDatabase::DateFormatToPHP(CSite::GetDateFormat("SHORT", SITE_ID))), GetMessage("SPA_MY_ACCOUNT"));
    do {
        $arResultTmp["CURRENCY"] = CCurrencyLang::GetByID($arAccountList["CURRENCY"], LANGUAGE_ID);
        $arResultTmp["ACCOUNT_LIST"] = $arAccountList;
        $arResultTmp["INFO"] = str_replace("#CURRENCY#", $arResultTmp["CURRENCY"]["CURRENCY"] . " (" . $arResultTmp["CURRENCY"]["FULL_NAME"] . ")", str_replace("#SUM#", SaleFormatCurrency($arAccountList["CURRENT_BUDGET"], $arAccountList["CURRENCY"]), GetMessage("SPA_IN_CUR")));
        $arResult["ACCOUNT_LIST"][] = $arResultTmp;
    } while ($arAccountList = $dbAccountList->GetNext());
} else {
    $arResult["ERROR_MESSAGE"] = GetMessage("SPA_NO_ACCOUNT");
}
$this->IncludeComponentTemplate();
Esempio n. 18
0
            echo "<li>" . GetMessage("PPL_T3") . ": {$firstname} {$lastname}</li>\n";
            echo "<li>" . GetMessage("PPL_T4") . ": {$itemname}</li>\n";
            echo "<li>" . GetMessage("PPL_T5") . ": {$amount}</li>\n";
        } elseif (strcmp($res, "VERIFIED") == 0) {
            $strPS_STATUS_MESSAGE = "";
            $strPS_STATUS_MESSAGE .= GetMessage("PPL_T3") . ": " . $_POST["first_name"] . " " . $_POST["last_name"] . "; ";
            $strPS_STATUS_MESSAGE .= "Email: " . $_POST["payer_email"] . "; ";
            $strPS_STATUS_MESSAGE .= GetMessage("PPL_T4") . ": " . $_POST["item_name"] . "; ";
            $strPS_STATUS_MESSAGE .= GetMessage("PPL_T5") . ": " . $_POST["mc_gross"] . "; ";
            $strPS_STATUS_DESCRIPTION = "";
            $strPS_STATUS_DESCRIPTION .= "Payment status - " . $_POST["payment_status"] . "; ";
            $strPS_STATUS_DESCRIPTION .= "Payment sate - " . $_POST["payment_date"] . "; ";
            $arOrder = CSaleOrder::GetByID($_POST["custom"]);
            $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $_POST["mc_gross"], "PS_CURRENCY" => $_POST["mc_currency"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
            $arFields["PAY_VOUCHER_NUM"] = $tx;
            $arFields["PAY_VOUCHER_DATE"] = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)));
            if (IntVal($arOrder["PRICE"]) == IntVal($_POST["mc_gross"]) && $_POST["receiver_email"] == CSalePaySystemAction::GetParamValue("BUSINESS") && $_POST["payment_status"] == "Completed" && strlen($arOrder["PAY_VOUCHER_NUM"]) <= 0 && $arOrder["PAY_VOUCHER_NUM"] != $tx) {
                CSaleOrder::PayOrder($arOrder["ID"], "Y");
            }
            if (strlen($arOrder["PAY_VOUCHER_NUM"]) <= 0 || $arOrder["PAY_VOUCHER_NUM"] != $tx) {
                CSaleOrder::Update($arOrder["ID"], $arFields);
            }
        } else {
            echo "<p>" . GetMessage("PPL_I1") . "</p>";
        }
    } else {
        echo "<p>" . GetMessage("PPL_I2") . "</p>";
    }
    fclose($fp);
}
?>
Esempio n. 19
0
    } else {
        $strPS_STATUS_DESCRIPTION = (IntVal($mass[1]) == 2 ? "Declined" : "Error") . ": " . $mass[4] . " (Reason Code " . $mass[3] . " / Sub " . $mass[2] . ")";
        $strErrorMessage .= (IntVal($mass[1]) == 2 ? "Transaction was declined" : "Error while processing transaction") . ": " . $mass[4] . " (" . $mass[3] . "/" . $mass[2] . ")";
    }
    $strPS_STATUS_MESSAGE = "";
    if (!empty($mass[6])) {
        $strPS_STATUS_MESSAGE .= "\nAVS Result: [" . $mass[6] . "] " . $arAVSErr[$mass[6]] . ";";
    }
    if (!empty($mass[39])) {
        $strPS_STATUS_MESSAGE .= "\nCard Code Result: [" . $mass[39] . "] " . $arCVVErr[$mass[39]] . ";";
    }
    if (!empty($mass[40])) {
        $strPS_STATUS_MESSAGE .= "\nCAVV: [" . $mass[40] . "] " . $arCAVVErr[$mass[40]] . ";";
    }
    $strPS_SUM = $mass[10];
    $arFields = array("PS_STATUS" => $strPS_STATUS, "PS_STATUS_CODE" => $strPS_STATUS_CODE, "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $strPS_SUM, "PS_CURRENCY" => $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["CURRENCY"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
    // You can uncomment this code if you want PAYED flag to be set automatically
    /*
    $arOrder = CSaleOrder::GetByID($ORDER_ID);
    if ($arOrder["PRICE"] == $arFields["PS_SUM"] && $arFields["PS_STATUS"] == "Y")
    {
    	CSaleOrder::PayOrder($arOrder["ID"], "Y");
    }
    */
    CSaleOrder::Update($ORDER_ID, $arFields);
    if (strlen($strErrorMessage) <= 0) {
        $bSuccessProcess = True;
    }
}
if ($bSuccessProcess) {
    ?>
Esempio n. 20
0
        if ($bCorrectPayment && $CHECKSUM != $strCheck) {
            $bCorrectPayment = False;
        }
        if ($bCorrectPayment) {
            $strPS_STATUS_DESCRIPTION = "";
            $strPS_STATUS_DESCRIPTION .= "номер счета - " . $invoice . "; ";
            $strPS_STATUS_DESCRIPTION .= "номер платежа - " . $payment_id . "; ";
            $strPS_STATUS_DESCRIPTION .= "дата платежа - " . $date . "";
            $strPS_STATUS_DESCRIPTION .= "код подтверждения платежа - " . $confirmed . "";
            $strPS_STATUS_MESSAGE = "";
            if (isset($payer) && strlen($payer) > 0) {
                $strPS_STATUS_MESSAGE .= "e-mail покупателя - " . $payer . "; ";
            }
            $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $value, "PS_CURRENCY" => $currency, "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
            // You can comment this code if you want PAYED flag not to be set automatically
            if ($arOrder["PRICE"] == $value && IntVal($confirmed) == 1) {
                $arFields["PAYED"] = "Y";
                $arFields["DATE_PAYED"] = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)));
                $arFields["EMP_PAYED_ID"] = false;
            }
            if (CSaleOrder::Update($arOrder["ID"], $arFields)) {
                echo "OK";
            }
        }
    } else {
        echo "Код заказа не задан";
    }
} else {
    echo "Вид операции не PAYMENT";
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
Esempio n. 21
0
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$inv_id = IntVal($_REQUEST["inv_id"]);
if (IntVal($inv_id) > 0) {
    $bCorrectPayment = True;
    $inv_id = IntVal($_REQUEST["inv_id"]);
    $out_summ = $_REQUEST["OutSum"];
    $crc = $_REQUEST["SignatureValue"];
    if (!($arOrder = CSaleOrder::GetByID(IntVal($inv_id)))) {
        $bCorrectPayment = False;
    }
    if ($bCorrectPayment) {
        CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]);
    }
    $mrh_pass2 = CSalePaySystemAction::GetParamValue("ShopPassword2");
    $strCheck = md5($out_summ . ":" . $inv_id . ":" . $mrh_pass2);
    if ($bCorrectPayment && strtoupper($CHECKSUM) != strtoupper($strCheck)) {
        $bCorrectPayment = False;
    }
    if ($bCorrectPayment) {
        $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $out_summ, "PS_CURRENCY" => "", "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
        // You can comment this code if you want PAYED flag not to be set automatically
        if ($arOrder["PRICE"] == $out_summ) {
            CSaleOrder::PayOrder($arOrder["ID"], "Y");
        }
        if (CSaleOrder::Update($arOrder["ID"], $arFields)) {
            echo "OK";
        }
    }
}
        $ps_order = $ps_order[1];
        $arOrder = CSaleOrder::GetByID($ps_order);
        
        if (abs(intval($arOrder["PRICE"]) - intval($data['withdraw_amount'])) <= 1) {
        	CSaleOrder::PayOrder($arOrder["ID"], "Y");
        	CSaleOrder::StatusOrder($arOrder["ID"], 'P');
        	
        	$arFields = array(
        		"PS_STATUS" => "Y",
        		"PAYED" => "Y",
        		"PS_STATUS_CODE" => "Y",
        		"PS_STATUS_DESCRIPTION" => print_r($_REQUEST, true),
        		"PS_STATUS_MESSAGE" => "Оплачено",
        		"PS_SUM" => $data['withdraw_amount'],
        		"PS_CURRENCY" => 'RUB',
        		"PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))),
        		"PAY_VOUCHER_NUM" => $data['operation_id'],
        		"PAY_VOUCHER_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))),
        		"USER_ID" => $arOrder["USER_ID"],
        	);
    
        	CSaleOrder::Update($arOrder["ID"], $arFields);
        	
        	die("OK");
        }
        else die("Неверная сумма оплаты");
    }
    else die("Неверная метка платежа");
}
else die("Неверный хеш");
?>
Esempio n. 23
0
    }
}
$arResult["GROUPS_FORUMS"] = $arGroups;
$arParams["FID"] = array_intersect($arParams["FID"], array_keys($arResult["FORUMS"]));
/************** Search data ****************************************/
if (strLen($_REQUEST["q"]) > 0 || !empty($_REQUEST["tags"])) {
    if ($_REQUEST["order"] == "date") {
        $arResult["order"]["active"] = "date";
        $aSort = array("DATE_CHANGE" => "DESC");
    } elseif ($_REQUEST["order"] == "topic") {
        $arResult["order"]["active"] = "topic";
        $aSort = array("PARAM2" => "DESC", "DATE_CHANGE" => "ASC");
    }
    $arFilter1 = array("MODULE_ID" => "forum", "SITE_ID" => SITE_ID, "QUERY" => $q, "TAGS" => $_REQUEST["tags"] ? $_REQUEST["tags"] : "");
    if (intVal($_REQUEST["DATE_CHANGE"]) > 0) {
        $arFilter1["DATE_CHANGE"] = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANGUAGE_ID)), time() - intVal($_REQUEST["DATE_CHANGE"]) * 24 * 3600 + CTimeZone::GetOffset());
    }
    $arFilter2 = array();
    if (!empty($arParams["FID_RANGE"]) || !empty($arParams["FID"])) {
        $arFilter2["PARAM1"] = empty($arParams["FID_RANGE"]) ? array() : array_keys($arResult["FORUMS"]);
        $arFilter2["PARAM1"] = empty($arParams["FID"]) ? $arFilter2["PARAM1"] : $arParams["FID"];
    }
    $obSearch = new CSearch();
    //When restart option is set we will ignore error on query with only stop words
    $obSearch->SetOptions(array("ERROR_ON_EMPTY_STEM" => $arParams["RESTART"] != "Y", "NO_WORD_LOGIC" => $arParams["NO_WORD_LOGIC"] == "Y"));
    $obSearch->Search($arFilter1, $aSort, array($arFilter2));
    if ($obSearch->errorno != 0) {
        $arResult["ERROR_MESSAGE"] = $obSearch->error;
    } else {
        $obSearch->NavStart($arParams["TOPICS_PER_PAGE"], false);
        $obSearch->nPageWindow = $arParams["PAGE_NAVIGATION_WINDOW"];
')" id="cf_tr_select_dfile_<?php 
                echo $arFile["TIMESTAMP_X"];
                ?>
">
								<td style="text-align: center;"><input type="radio" name="cf_select_dfile" id="cf_select_dfile_<?php 
                echo $arFile["TIMESTAMP_X"];
                ?>
"<?php 
                echo $f ? " checked" : "";
                ?>
 value="<?php 
                echo $arFile["TIMESTAMP_X"];
                ?>
"></td>
								<td style="text-align: center;"><?php 
                echo Date(CDatabase::DateFormatToPHP(FORMAT_DATETIME), $arFile["TIMESTAMP_X"]);
                ?>
</td>
								<td style="text-align: center;"><?php 
                if (($arFile["REGION"] & BX_FILE_CHECKER_REGION_KERNEL) != 0) {
                    echo GetMessage("MFC1_R_KERNEL") . " ( /bitrix/modules )<br />";
                }
                if (($arFile["REGION"] & BX_FILE_CHECKER_REGION_ROOT) != 0) {
                    echo GetMessage("MFC1_R_SYSTEM") . " ( /bitrix )<br />";
                }
                if (($arFile["REGION"] & BX_FILE_CHECKER_REGION_PERSONAL_ROOT) != 0) {
                    echo GetMessage("MFC1_R_PSYSTEM") . " ( " . BX_PERSONAL_ROOT . " )<br />";
                }
                if (($arFile["REGION"] & BX_FILE_CHECKER_REGION_PUBLIC) != 0) {
                    echo GetMessage("MFC1_R_PUBLIC") . "<br />";
                }
Esempio n. 25
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_GET["server_responce"]) && $_GET["server_responce"] == "Y" && !empty($_POST["cartId"])) {
    $bCorrect = True;
    if ($bCorrect && !($arOrder = CSaleOrder::GetByID(IntVal($_POST["cartId"])))) {
        $bCorrect = False;
    }
    if ($bCorrect) {
        CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]);
        $strCallbackPassword = CSalePaySystemAction::GetParamValue("CALLBACK_PASSWORD");
        if (strlen($strCallbackPassword) <= 0 || $_POST["callbackPW"] != $strCallbackPassword) {
            $bCorrect = False;
        }
    }
    if ($bCorrect && isset($_POST["testMode"]) && IntVal($_POST["testMode"]) > 0) {
        $bCorrect = False;
    }
    if ($bCorrect) {
        $arFields = array("PS_STATUS" => $_POST["transStatus"] == "Y" ? "Y" : "N", "PS_STATUS_CODE" => $_POST["transStatus"], "PS_STATUS_DESCRIPTION" => $_POST["rawAuthMessage"], "PS_STATUS_MESSAGE" => $_POST["transStatus"] == "Y" ? "The WorldPay ID for this transaction: " . $_POST["transId"] . ", Time of this transaction: " . Date("r", $_POST["transTime"]) : "", "PS_SUM" => $_POST["authAmount"], "PS_CURRENCY" => $_POST["authCurrency"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
        if ($arOrder["CURRENCY"] == $_POST["authCurrency"] && $arOrder["PRICE"] == $_POST["authAmount"]) {
            CSaleOrder::PayOrder($arOrder["ID"], "Y");
        }
        CSaleOrder::Update($arOrder["ID"], $arFields);
    }
}
Esempio n. 26
0
            $strPS_STATUS_DESCRIPTION .= "номер счета - " . $_POST["LMI_SYS_INVS_NO"] . "; ";
            $strPS_STATUS_DESCRIPTION .= "номер платежа - " . $_POST["LMI_SYS_PAYMENT_ID"] . "; ";
            $strPS_STATUS_DESCRIPTION .= "дата платежа - " . $_POST["LMI_SYS_PAYMENT_DATE"] . "";
            $strPS_STATUS_DESCRIPTION .= "платежная система - " . $_POST["LMI_PAYMENT_SYSTEM"] . "";
            $strPS_STATUS_MESSAGE = "";
            if (isset($_POST["LMI_PAYER_PURSE"]) && strlen($_POST["LMI_PAYER_PURSE"]) > 0) {
                $strPS_STATUS_MESSAGE .= "кошелек покупателя - " . $_POST["LMI_PAYER_PURSE"] . "; ";
            }
            if (isset($_POST["LMI_PAYER_WM"]) && strlen($_POST["LMI_PAYER_WM"]) > 0) {
                $strPS_STATUS_MESSAGE .= "WMId покупателя - " . $_POST["LMI_PAYER_WM"] . "; ";
            }
            if (isset($_POST["LMI_PAYMER_NUMBER"]) && strlen($_POST["LMI_PAYMER_NUMBER"]) > 0) {
                $strPS_STATUS_MESSAGE .= "номер ВМ-карты - " . $_POST["LMI_PAYMER_NUMBER"] . "; ";
            }
            if (isset($_POST["LMI_PAYMER_EMAIL"]) && strlen($_POST["LMI_PAYMER_EMAIL"]) > 0) {
                $strPS_STATUS_MESSAGE .= "paymer.com e-mail покупателя - " . $_POST["LMI_PAYMER_EMAIL"] . "; ";
            }
            if (isset($_POST["LMI_TELEPAT_PHONENUMBER"]) && strlen($_POST["LMI_TELEPAT_PHONENUMBER"]) > 0) {
                $strPS_STATUS_MESSAGE .= "телефон покупателя - " . $_POST["LMI_TELEPAT_PHONENUMBER"] . "; ";
            }
            if (isset($_POST["LMI_TELEPAT_ORDERID"]) && strlen($_POST["LMI_TELEPAT_ORDERID"]) > 0) {
                $strPS_STATUS_MESSAGE .= "платеж в Телепате - " . $_POST["LMI_TELEPAT_ORDERID"] . "";
            }
            $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $_POST["LMI_PAYMENT_AMOUNT"], "PS_CURRENCY" => $arOrder["CURRENCY"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
            if ($arOrder["PRICE"] == $_POST["LMI_PAYMENT_AMOUNT"] && $currency == DoubleVal($_POST["LMI_CURRENCY"]) && $CNST_PAYEE_PURSE == $_POST["LMI_MERCHANT_ID"] && $arOrder["PAYED"] != "Y") {
                CSaleOrder::PayOrder($arOrder["ID"], "Y");
            }
            CSaleOrder::Update($arOrder["ID"], $arFields);
        }
    }
}
    if ($lmi_payee_purse != $IdM) {
        $err = 3;
        $err_text = 'ERR: НЕВЕРЕН ID МАГАЗИНА : ' . $lmi_payee_purse;
    }
    if ($lmi_prerequest == 1) {
        if ($err != 0) {
            echo $err_text;
        } else {
            echo 'YES';
        }
    } else {
        $common_string = $lmi_payee_purse . $lmi_payment_amount . $lmi_payment_no . $lmi_mode . $lmi_sys_invs_no . $lmi_sys_trans_no . $lmi_sys_trans_date . $sk . $lmi_payer_purse . $lmi_payer_wm;
        $hash = ToUpper(md5($common_string));
        if ($err == 0) {
            if ($hash == $lmi_hash) {
                $strPS_STATUS_DESCRIPTION = "";
                $strPS_STATUS_DESCRIPTION .= "Идентификатор магазина - " . $lmi_payee_purse . "; ";
                $strPS_STATUS_DESCRIPTION .= "Внутренний номер платежа  в системе Z-PAYMENT - " . $lmi_sys_invs_no . "; ";
                $strPS_STATUS_DESCRIPTION .= "Внутренний номер счета в системе Z-PAYMENT - " . $lmi_sys_trans_no . "; ";
                $strPS_STATUS_DESCRIPTION .= "дата платежа - " . $lmi_sys_trans_date . "";
                $strPS_STATUS_MESSAGE = "";
                $strPS_STATUS_MESSAGE .= "кошелек покупателя или его e-mail  - " . $lmi_payer_purse . "; ";
                $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $lmi_payment_amount, "PS_CURRENCY" => $arOrder["CURRENCY"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
                // You can comment this code if you want PAYED flag not to be set automatically
                CSaleOrder::PayOrder($arOrder["ID"], "Y");
                CSaleOrder::Update($arOrder["ID"], $arFields);
            }
        }
    }
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
Esempio n. 28
0
    public static function Init($Params)
    {
        global $USER;
        $arWarnings = array();
        if (!$USER->CanDoOperation('fileman_admin_files') && !$USER->CanDoOperation('fileman_admin_folders')) {
            $arWarnings[] = GetMessage('FM_UTIL_ACCESS_DENIED');
        }
        $io = CBXVirtualIo::GetInstance();
        if (count($arWarnings) == 0) {
            $pathTo = trim($Params['copyTo'], " /");
            $site = CFileMan::__CheckSite($_GET['site']);
            $siteTo = $Params['siteTo'] ? $Params['siteTo'] : $site;
            $pathTo = $pathTo == "" ? "/" : "/" . $pathTo . "/";
            $absPathTo = CSite::GetSiteDocRoot($siteTo) . $pathTo;
            $docRootFrom = CSite::GetSiteDocRoot($site);
            if (!$io->DirectoryExists($absPathTo)) {
                // Create destination directory
                $bAccess = $USER->CanDoOperation('fileman_admin_folders') && $USER->CanDoFileOperation('fm_create_new_folder', $pathTo);
                if ($Params['createCopyTo']) {
                    if ($bAccess) {
                        CFileMan::CreateDir(array($siteTo, $pathTo));
                    }
                } else {
                    ?>
<script>window.BXFM_NoCopyToDir = "<?php 
                    echo $bAccess ? "ask_user" : "access_denied";
                    ?>
";</script><?php 
                    return;
                }
            }
            foreach ($Params['arFiles'] as $file) {
                $filePath = $file['path'];
                $caseOption = $Params['caseOption'];
                if ($Params["userCaseLastPath"]) {
                    if ($Params["userCaseLastPath"] != $filePath) {
                        continue;
                    }
                    $caseOption = $Params['userCaseAnswer'];
                    if ($Params["userCaseToAll"]) {
                        $Params['caseOption'] = $caseOption;
                    }
                    $Params["userCaseLastPath"] = false;
                }
                $arPath_i = array($site, $filePath);
                $absPath_i = $docRootFrom . $filePath;
                $bDir_i = $io->DirectoryExists($absPath_i);
                $name_i = CFileman::GetFileName($filePath);
                $strWarn = "";
                // Check if file already exists in destination folder
                if ($io->FileExists($absPathTo . $name_i) || $bDir_i == $io->DirectoryExists($absPathTo . $name_i) && $bDir_i) {
                    $fTmp = $io->GetFile($absPathTo . $name_i);
                    $fTmp1 = $io->GetFile($absPath_i);
                    $altName = CFilemanCopy::GetAltFileName($absPathTo, $name_i, $bDir_i);
                    if ($caseOption == 'ask') {
                        ?>
<script>
						window.BXFM_fileExist = {
							fileOld: {
								name: "<?php 
                        echo CUtil::JSEscape($name_i);
                        ?>
",
								path: "<?php 
                        echo CUtil::JSEscape($pathTo . $name_i);
                        ?>
",
								site: "<?php 
                        echo CUtil::JSEscape($siteTo);
                        ?>
",
								bDir: <?php 
                        echo $bDir_i ? "true" : "false";
                        ?>
,
								size: "<?php 
                        echo $bDir_i ? '-' : CFile::FormatSize($fTmp->GetFileSize());
                        ?>
",
								date: "<?php 
                        echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL")), CFilemanUtils::GetModifyTime($absPathTo . $name_i) + CTimeZone::GetOffset());
                        ?>
"
							},
							fileNew: {
								alt_name: "<?php 
                        echo CUtil::JSEscape($altName);
                        ?>
",
								name: "<?php 
                        echo CUtil::JSEscape($name_i);
                        ?>
",
								path: "<?php 
                        echo CUtil::JSEscape($filePath);
                        ?>
",
								site: "<?php 
                        echo CUtil::JSEscape($site);
                        ?>
",
								bDir: <?php 
                        echo $bDir_i ? "true" : "false";
                        ?>
,
								size: "<?php 
                        echo $bDir_i ? '-' : CFile::FormatSize($fTmp1->GetFileSize());
                        ?>
",
								date: "<?php 
                        echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL")), CFilemanUtils::GetModifyTime($absPath_i) + CTimeZone::GetOffset());
                        ?>
"
							}
						};
						</script><?php 
                        return;
                    } elseif ($caseOption == 'replace') {
                        // We don't need to replace, couse it's one file
                        if (CFileMan::NormalizePath($pathTo . "/" . $name_i) == $filePath) {
                            continue;
                        }
                        $strWarn = CFileMan::CopyEx($arPath_i, array($siteTo, CFileMan::NormalizePath($pathTo . "/" . $name_i)), !$Params['bCopy'], true);
                        if ($strWarn != "") {
                            $arWarnings[] = $strWarn;
                            $log = false;
                        } elseif ($Params['bSearch'] && $Params['ssess'] && !$Params['bCopy']) {
                            CFilemanSearch::DelFromSearchResult($Params['ssess'], $filePath);
                        }
                    } elseif ($caseOption == 'auto_rename') {
                        $strWarn = CFileMan::CopyEx($arPath_i, array($siteTo, CFileMan::NormalizePath($pathTo . "/" . $altName)), !$Params['bCopy']);
                        if ($strWarn != "") {
                            $arWarnings[] = $strWarn;
                            $log = false;
                        } elseif ($Params['bSearch'] && $Params['ssess'] && !$Params['bCopy']) {
                            CFilemanSearch::DelFromSearchResult($Params['ssess'], $filePath);
                        }
                    } elseif ($caseOption == 'skip') {
                        continue;
                    }
                } else {
                    $strWarn = CFileMan::CopyEx($arPath_i, array($siteTo, CFileMan::NormalizePath($pathTo . "/" . $name_i)), !$Params['bCopy']);
                    if ($strWarn != "") {
                        $arWarnings[] = $strWarn;
                        $log = false;
                    } elseif ($Params['bSearch'] && $Params['ssess'] && !$Params['bCopy']) {
                        CFilemanSearch::DelFromSearchResult($Params['ssess'], $filePath);
                    }
                }
                $module_id = "fileman";
                if (COption::GetOptionString($module_id, "log_page", "Y") == "Y" && $log) {
                    $res_log['copy_to'] = substr($pathTo, 1);
                    $res_log['path'] = substr($filePath, 1);
                    if ($Params['bCopy'] == "copy") {
                        if (!$bDir_i) {
                            CEventLog::Log("content", "FILE_COPY", "fileman", "", serialize($res_log));
                        } else {
                            CEventLog::Log("content", "SECTION_COPY", "fileman", "", serialize($res_log));
                        }
                    } else {
                        if (!$bDir_i) {
                            CEventLog::Log("content", "FILE_MOVE", "fileman", "", serialize($res_log));
                        } else {
                            CEventLog::Log("content", "SECTION_MOVE", "fileman", "", serialize($res_log));
                        }
                    }
                }
            }
        }
        $arWarnings;
        ?>
<script>
		window.BXFM_result = {
			status: "<?php 
        echo count($arWarnings) > 0 ? 'errors' : 'ok';
        ?>
",
			errors: <?php 
        echo count($arWarnings) > 0 ? CUtil::PhpToJSObject($arWarnings) : '{}';
        ?>
		};
		</script><?php 
    }
Esempio n. 29
0
 $parms .= "&VENDOR=" . urlencode($PF_USER);
 // Vendor ID
 $parms .= "&ZIP=" . urlencode($zipcode);
 // Zip
 $parms .= "&STREET=" . urlencode($address1);
 // Address
 $parms .= "&COMMENT1=" . urlencode($ORDER_ID);
 $parms .= "&COMMENT2=" . urlencode($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT"]);
 $ret_com = "{$strExePath} {$PF_HOST} {$PF_PORT} \"{$parms}\" 30";
 putenv("PFPRO_CERT_PATH=" . $PFPRO_CERT_PATH);
 putenv("LD_LIBRARY_PATH=" . $strExeDir);
 exec($ret_com, $arOutput, $ret_var);
 $strOutput = $arOutput[0];
 parse_str($strOutput, $arResult);
 if (is_array($arResult) && strlen($arResult["RESULT"]) > 0) {
     $arFields = array("PS_STATUS" => $arResult["RESULT"] == 0 ? "Y" : "N", "PS_STATUS_CODE" => $arResult["RESULT"], "PS_STATUS_DESCRIPTION" => $arResult["RESPMSG"] . " - " . $arResult["PREFPSMSG"], "PS_STATUS_MESSAGE" => $arResult["PNREF"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
     $arResult["RESULT"] = IntVal($arResult["RESULT"]);
     if ($arResult["RESULT"] == 0) {
         CSaleOrder::PayOrder($ORDER_ID, "Y");
     }
     CSaleOrder::Update($ORDER_ID, $arFields);
     $arResult["RESULT"] = IntVal($arResult["RESULT"]);
     if ($arResult["RESULT"] == 0) {
         $bNonePay = False;
     } else {
         if ($arResult["RESULT"] < 0) {
             $strErrorTmp .= "Communication Error: [" . $arResult["RESULT"] . "] " . $arResult["RESPMSG"] . " - " . $arResult["PREFPSMSG"] . ". ";
         } elseif ($arPaySysRes_tmp["RESULT"] == 125) {
             $strErrorTmp .= "Your payment is declined by Fraud Service. Please contact us to make payment. ";
         } elseif ($arResult["RESULT"] == 126) {
             $strErrorTmp .= "Your payment is under review by Fraud Service. We contact you in 48 hours to get more specific information. ";
Esempio n. 30
0
 public static function DFormat($bTime = true)
 {
     return CDatabase::DateFormatToPHP(CSite::GetDateFormat($bTime ? "FULL" : "SHORT", SITE_ID));
 }