本文整理汇总了PHP中CSaleOrder::StatusOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::StatusOrder方法的具体用法?PHP CSaleOrder::StatusOrder怎么用?PHP CSaleOrder::StatusOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::StatusOrder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
'COMMENTS' => ICrmOrderActions::fromJSON($order['managerComment'])
));
if (isset($order['discount'])) {
$arFields['DISCOUNT_VALUE'] = $order['discount'];
$arFields['PRICE'] -= $order['discount'];
}
if(!empty($arFields)) {
CSaleOrder::Update($order['externalId'], $arFields);
}
if(isset($order['status']) && $order['status']) {
if(isset($optionsPayStatuses[$order['status']]) && $optionsPayStatuses[$order['status']]) {
// set STATUS_ID
CSaleOrder::StatusOrder($order['externalId'], $optionsPayStatuses[$order['status']]);
if($wasCanaceled && $optionsPayStatuses[ $order['status'] ] != 'YY') {
CSaleOrder::CancelOrder($order['externalId'], "N", $order['statusComment']);
} elseif ($optionsPayStatuses[ $order['status'] ] == 'YY') {
CSaleOrder::CancelOrder($order['externalId'], "Y", $order['statusComment']);
}
}
}
// set PAYED
if(isset($order['paymentStatus']) && $order['paymentStatus'] && $optionsPayment[$order['paymentStatus']]) {
CSaleOrder::PayOrder($order['externalId'], $optionsPayment[$order['paymentStatus']]);
}
if(function_exists('intarocrm_order_post_persist')) {
示例2: __MakeOrder
elseif($key == "PHONE")
$arProp["VALUE"] = "8 495 2312121";
elseif($key == "ZIP")
$arProp["VALUE"] = "101000";
elseif($key == "LOCATION")
$arProp["VALUE"] = $location;
elseif($key == "CITY")
$arProp["VALUE"] = $shopLocation;
$arData["PROPS"][] = $arProp;
}
$orderID = __MakeOrder(3, $arData);
CSaleOrder::DeliverOrder($orderID, "Y");
CSaleOrder::PayOrder($orderID, "Y");
CSaleOrder::StatusOrder($orderID, "F");
$orderID = __MakeOrder(4, $arData);
CSaleOrder::DeliverOrder($orderID, "Y");
CSaleOrder::PayOrder($orderID, "Y");
CSaleOrder::StatusOrder($orderID, "F");
$orderID = __MakeOrder(2, $arData);
CSaleOrder::PayOrder($orderID, "Y");
CSaleOrder::StatusOrder($orderID, "P");
$orderID = __MakeOrder(1, $arData);
$orderID = __MakeOrder(3, $arData);
CSaleOrder::CancelOrder($orderID, "Y");
CAgent::RemoveAgent("CSaleProduct::RefreshProductList();", "sale");
CAgent::AddAgent("CSaleProduct::RefreshProductList();", "sale", "N", 60*60*24*4, "", "Y");
}
}
return true;
?>
示例3: SetStatus
public function SetStatus($ID, $statusID, $statusParams = false, $options = array())
{
global $USER;
if (!CModule::IncludeModule('sale')) {
return false;
}
$currentUserId = 0;
if (isset($USER) && (get_class($USER) === 'CUser' || $USER instanceof CUser)) {
$currentUserId = $USER->GetID();
}
$result = true;
if (!self::$INVOICE_STATUSES) {
self::$INVOICE_STATUSES = CCrmStatus::GetStatus('INVOICE_STATUS');
}
if (!is_array(self::$INVOICE_STATUSES) || count(self::$INVOICE_STATUSES) <= 2 || !array_key_exists('P', self::$INVOICE_STATUSES) || !array_key_exists('D', self::$INVOICE_STATUSES) || self::$INVOICE_STATUSES['P']['SORT'] >= self::$INVOICE_STATUSES['D']['SORT']) {
$result = false;
}
if ($result) {
$CSaleOrder = new CSaleOrder();
// get current state
if (!($arOrder = CSaleOrder::GetByID($ID))) {
$result = false;
}
if ($result) {
$curPay = $arOrder['PAYED'];
$curCancel = $arOrder['CANCELED'];
$curMarked = $arOrder['MARKED'];
$curStatusID = $arOrder['STATUS_ID'];
$pay = $cancel = 'N';
$marked = isset($statusParams['REASON_MARKED']) || isset($statusParams['DATE_MARKED']) ? 'Y' : 'N';
if (self::$INVOICE_STATUSES[$statusID]['SORT'] >= self::$INVOICE_STATUSES['P']['SORT']) {
$pay = 'Y';
}
if (self::$INVOICE_STATUSES[$statusID]['SORT'] >= self::$INVOICE_STATUSES['D']['SORT']) {
$pay = 'N';
$cancel = 'Y';
}
if ($curPay != $pay) {
$result = $CSaleOrder->PayOrder($ID, $pay, true, true, 0, array('NOT_CHANGE_STATUS' => 'Y'));
}
if ($result && $curCancel != $cancel) {
$result = $CSaleOrder->CancelOrder($ID, $cancel);
}
if ($result && $marked === 'Y') {
$result = $CSaleOrder->SetMark($ID, isset($statusParams['REASON_MARKED']) ? $statusParams['REASON_MARKED'] : '', $currentUserId);
}
if ($result) {
$arUpdate = array();
if (isset($statusParams['DATE_MARKED'])) {
$arUpdate['DATE_MARKED'] = $statusParams['DATE_MARKED'];
}
if ($pay === 'Y') {
if (isset($statusParams['PAY_VOUCHER_NUM'])) {
$arUpdate['PAY_VOUCHER_NUM'] = $statusParams['PAY_VOUCHER_NUM'];
}
if (isset($statusParams['PAY_VOUCHER_DATE'])) {
$arUpdate['PAY_VOUCHER_DATE'] = $statusParams['PAY_VOUCHER_DATE'];
}
}
if (count($arUpdate) > 0) {
$result = self::Update($ID, $arUpdate);
}
unset($arUpdate);
}
if ($result && $curStatusID != $statusID) {
$result = $CSaleOrder->StatusOrder($ID, $statusID) === $ID;
}
}
}
if ($result && is_array($options) && isset($options['SYNCHRONIZE_LIVE_FEED']) && $options['SYNCHRONIZE_LIVE_FEED']) {
self::SynchronizeLiveFeedEvent($ID, array('PROCESS_PARENTS' => false, 'REFRESH_DATE' => true));
}
return $result;
}
示例4: foreach
foreach ($ps_arr as $key) {
$ps_p_sign .= trim($_REQUEST[$key]) . "&";
}
$ps_p_sign .= $ps_key . "&" . $data['label'];
$ps_hash = sha1($ps_p_sign);
if (strtolower($data['sha1_hash']) == strtolower($ps_hash)) {
if (strpos($data['label'], "ORDER#") !== false) {
// order info
$ps_order = explode("#", $data['label']);
$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"],
);
示例5: fChangeOrderStatus
function fChangeOrderStatus($ID, $STATUS_ID)
{
global $APPLICATION;
global $crmMode;
$errorMessageTmp = "";
$STATUS_ID = trim($STATUS_ID);
if (strlen($STATUS_ID) <= 0)
$errorMessageTmp .= GetMessage("ERROR_NO_STATUS").". ";
if ('' == $errorMessageTmp)
{
if (!CSaleOrder::CanUserChangeOrderStatus($ID, $STATUS_ID, $GLOBALS["USER"]->GetUserGroupArray()))
$errorMessageTmp .= GetMessage("SOD_NO_PERMS2STATUS").". ";
}
if ('' == $errorMessageTmp)
{
if (!CSaleOrder::StatusOrder($ID, $STATUS_ID))
{
if ($ex = $APPLICATION->GetException())
{
if ($ex->GetID() != "ALREADY_FLAG")
$errorMessageTmp .= $ex->GetString();
}
else
$errorMessageTmp .= GetMessage("ERROR_CHANGE_STATUS").". ";
}
}
$arResult = array(
'STATUS_ERR' => false,
'STATUS_ERR_MESS' => '',
);
$dbOrder = CSaleOrder::GetList(
array("ID" => "DESC"),
array("ID" => $ID),
false,
false,
array("DATE_STATUS", "EMP_STATUS_ID", "STATUS_ID")
);
if ($arOrder = $dbOrder->Fetch())
{
$arResult["DATE_STATUS"] = $arOrder["DATE_STATUS"];
if (!$crmMode && IntVal($arOrder["EMP_STATUS_ID"]) > 0)
$arResult["EMP_STATUS_ID"] = GetFormatedUserName($arOrder["EMP_STATUS_ID"], false);
$arResult["STATUS_ID"] = $arOrder["STATUS_ID"];
}
if ('' != $errorMessageTmp)
{
$arResult['STATUS_ERR'] = true;
$arResult['STATUS_ERR_MESS'] = $errorMessageTmp;
}
return $arResult;
}
示例6: DeliverOrder
function DeliverOrder($ID, $val, $recurringID = 0, $arAdditionalFields = array())
{
global $DB, $USER;
$ID = IntVal($ID);
$val = $val != "Y" ? "N" : "Y";
$recurringID = IntVal($recurringID);
$NO_CHANGE_STATUS = "N";
if (is_set($arAdditionalFields["NOT_CHANGE_STATUS"]) && $arAdditionalFields["NOT_CHANGE_STATUS"] == "Y") {
$NO_CHANGE_STATUS = "Y";
unset($arAdditionalFields["NOT_CHANGE_STATUS"]);
}
if ($ID <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_NO_ORDER_ID"), "NO_ORDER_ID");
return False;
}
$arOrder = CSaleOrder::GetByID($ID);
if (!$arOrder) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $ID, GetMessage("SKGO_NO_ORDER")), "NO_ORDER");
return False;
}
if ($arOrder["ALLOW_DELIVERY"] == $val) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $ID, GetMessage("SKGO_DUB_DELIVERY")), "ALREADY_FLAG");
return False;
}
foreach (GetModuleEvents("sale", "OnSaleBeforeDeliveryOrder", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, $val, $recurringID, $arAdditionalFields)) === false) {
return false;
}
}
$arFields = array("ALLOW_DELIVERY" => $val, "=DATE_ALLOW_DELIVERY" => $DB->GetNowFunction(), "EMP_ALLOW_DELIVERY_ID" => IntVal($USER->GetID()) > 0 ? IntVal($USER->GetID()) : false);
if (count($arAdditionalFields) > 0) {
foreach ($arAdditionalFields as $addKey => $addValue) {
if (!array_key_exists($addKey, $arFields)) {
$arFields[$addKey] = $addValue;
}
}
}
$res = CSaleOrder::Update($ID, $arFields);
unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
if ($recurringID <= 0) {
if (IntVal($arOrder["RECURRING_ID"]) > 0) {
$recurringID = IntVal($arOrder["RECURRING_ID"]);
}
}
CSaleBasket::OrderDelivery($ID, $val == "Y" ? True : False, $recurringID);
foreach (GetModuleEvents("sale", "OnSaleDeliveryOrder", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $val));
}
if ($val == "Y") {
CTimeZone::Disable();
$arOrder = CSaleOrder::GetByID($ID);
CTimeZone::Enable();
if ($NO_CHANGE_STATUS != "Y") {
$orderStatus = COption::GetOptionString("sale", "status_on_allow_delivery", "");
if (strlen($orderStatus) > 0 && $orderStatus != $arOrder["STATUS_ID"]) {
$dbStatus = CSaleStatus::GetList(array("SORT" => "ASC"), array("LID" => LANGUAGE_ID), false, false, array("ID", "SORT"));
while ($arStatus = $dbStatus->GetNext()) {
$arStatuses[$arStatus["ID"]] = $arStatus["SORT"];
}
if ($arStatuses[$orderStatus] >= $arStatuses[$arOrder["STATUS_ID"]]) {
CSaleOrder::StatusOrder($ID, $orderStatus);
}
}
}
$userEMail = "";
$dbOrderProp = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $arOrder["ID"], "PROP_IS_EMAIL" => "Y"));
if ($arOrderProp = $dbOrderProp->Fetch()) {
$userEMail = $arOrderProp["VALUE"];
}
if (strlen($userEMail) <= 0) {
$dbUser = CUser::GetByID($arOrder["USER_ID"]);
if ($arUser = $dbUser->Fetch()) {
$userEMail = $arUser["EMAIL"];
}
}
$eventName = "SALE_ORDER_DELIVERY";
$arFields = array("ORDER_ID" => $ID, "ORDER_DATE" => $arOrder["DATE_INSERT_FORMAT"], "EMAIL" => $userEMail, "SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@" . $_SERVER["SERVER_NAME"]));
$bSend = true;
foreach (GetModuleEvents("sale", "OnOrderDeliverSendEmail", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$eventName, &$arFields)) === false) {
$bSend = false;
}
}
if ($bSend) {
$event = new CEvent();
$event->Send($eventName, $arOrder["LID"], $arFields, "N");
}
}
//reservation
if (COption::GetOptionString("sale", "product_reserve_condition", "O") == "D") {
if (!CSaleOrder::ReserveOrder($ID, $val)) {
return false;
}
}
//proceed to deduction
if ($val == "Y") {
$allowDeduction = COption::GetOptionString("sale", "allow_deduction_on_delivery", "");
if ($allowDeduction == "Y" && $arOrder["DEDUCTED"] == "N") {
CSaleOrder::DeductOrder($ID, "Y");
}
//.........这里部分代码省略.........
示例7: strtoupper
<?php
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/include.php";
if (isset($_POST['SIGN'])) {
$sign = strtoupper(md5(md5($_POST['SHOP_ID']) . '&' . md5($_POST["ORDER_ID"]) . '&' . md5($_POST['STATE'])));
if ($_POST['SIGN'] == $sign) {
switch ($_POST['STATE']) {
case 'paid':
CSaleOrder::Update($_POST["ORDER_ID"], array("PAYED" => "Y"));
CSaleOrder::StatusOrder($_POST["ORDER_ID"], "P");
echo '<div class="ubr_s">”спешно совершено</div>';
break;
}
}
}
示例8: file_put_contents
$current .= "\n";
// Пишем содержимое обратно в файл
file_put_contents($file, $current);
/*include_once($_SERVER["DOCUMENT_ROOT"]."/include/1c_exchange/getProductsXML.php");
$getxml = new ProductsXML();
$xml = $getxml->getXML();
header('Content-type: text/xml');
echo $xml;*/
$arResult = array("ERROR" => "Не верный запрос");
// обновление статусов заказа
if ($_REQUEST["update"]) {
if ($_REQUEST["orders"] && CModule::IncludeModule("catalog") && CModule::IncludeModule("sale")) {
$arResult = "";
$arOrders = $_REQUEST["orders"];
foreach ($arOrders as $key => $order) {
if (!CSaleOrder::StatusOrder($order["ID"], $order["STATUS"])) {
$result = true;
} else {
$result = false;
}
$arResult[] = array("ID" => $order["ID"], "RESULT" => $result);
}
}
// все типы статусов
} elseif ($_REQUEST["getstatus"] && CModule::IncludeModule("catalog") && CModule::IncludeModule("sale")) {
$arResult = "";
$arStatus = array();
$rsStatus = CSaleStatus::GetList(array("ID" => "ASC"), array("LID" => "ru"));
while ($arStatus_tmp = $rsStatus->Fetch()) {
$arResult[] = array("ID" => $arStatus_tmp["ID"], "NAME" => $arStatus_tmp["NAME"], "DESCRIPTION" => $arStatus_tmp["DESCRIPTION"]);
}
示例9: Array
$arFilter = Array(
"ACCOUNT_NUMBER" =>$json['order']['shop_order_code']
);
$db_sales = CSaleOrder::GetList(array(), $arFilter);
while ($ar_sales = $db_sales->Fetch())
{
$ID = $ar_sales["ID"];
}
if ($order = CSaleOrder::GetByID($ID)) {
if($order['DELIVERY_ID'] == 'goparcel:simple') {
// status
if (CGPWidget::StatusExists($json['order']['status'])) {
$status_match = COption::GetOptionString($moduleID, "status_match_".$json['order']['status']);
if ($status_match && $status_match != $order['STATUS_ID']) {
$res = CSaleOrder::StatusOrder($order['ID'], $status_match);
if (!$res) { $error[] = 'could not change order.status to ['.$status_match.']'; } else {
$message[] = 'order '.$order['ID'].' changed status to ['.$status_match.']';
}
}
} else { $error[] = 'invalid order.status'; }
if (SITE_ID && $order['ID']) {
$order_props_res = CSaleOrderPropsValue::GetOrderProps($order['ID']);
while ($order_props_ar = $order_props_res->Fetch()) {
$order_props[] = $order_props_ar;
}
$gp_prop_list = array(
'customer_name',
'customer_email',
'customer_phone',
//'index',
示例10: ob_end_clean
ob_end_clean();
break;
case "get_history":
ob_start();
$APPLICATION->IncludeComponent('bitrix:sale.mobile.order.history', '.default', array(), false);
$result = ob_get_contents();
ob_end_clean();
break;
case "status_save":
if (!$status_id) {
break;
}
if (!CSaleOrder::CanUserChangeOrderStatus($id, $status_id, $GLOBALS["USER"]->GetUserGroupArray())) {
break;
}
$result = CSaleOrder::StatusOrder($id, $status_id);
break;
case "order_cancel":
$bUserCanCancelOrder = CSaleOrder::CanUserCancelOrder($id, $GLOBALS["USER"]->GetUserGroupArray(), $GLOBALS["USER"]->GetID());
if (!$bUserCanCancelOrder || CSaleOrder::IsLocked($id, $lockedBY, $dateLock)) {
break;
}
$cancel = isset($_REQUEST['cancel']) ? trim($_REQUEST['cancel']) : 'N';
$comment = isset($_REQUEST['comment']) ? trim($_REQUEST['comment']) : '';
if (strlen($comment) > 0) {
$comment = $APPLICATION->ConvertCharset($comment, 'utf-8', SITE_CHARSET);
}
$result = CSaleOrder::CancelOrder($id, $cancel, $comment);
break;
case "get_order_html":
$arOrder = CSaleMobileOrderUtils::getOrderInfoDetail($id);
示例11: Ubrir
$out = '<div class="ubr_f">Получить детализацию данного заказа невозможно. Либо его не существует, либо он был оплачен через Uniteller</div>';
}
}
break;
case '3':
if (!empty($_POST['shoporderidforstatus']) and !empty($_POST["VALUE2_ID_1"]) and !empty($_POST["VALUE2_SERT_1"])) {
$order_id = $_POST['shoporderidforstatus'] * 1;
$arOrder = CSaleOrder::GetByID($order_id);
if ($arOrder['PAYED'] == 'Y') {
if (!empty($arOrder['PS_STATUS_MESSAGE'])) {
$bankHandler = new Ubrir(array('shopId' => $_POST["VALUE2_ID_1"], 'order_id' => $order_id, 'sert' => $_POST["VALUE2_SERT_1"], 'twpg_order_id' => $arOrder['PS_STATUS_DESCRIPTION'], 'twpg_session_id' => $arOrder['PS_STATUS_MESSAGE']));
$res = $bankHandler->reverse_order();
if ($res == 'OK') {
$out = '<div class="ubr_s">Оплата успешно отменена</div>';
CSaleOrder::Update($order_id, array("PAYED" => "N"));
CSaleOrder::StatusOrder($order_id, "N");
} else {
$out = $res;
}
} else {
$out = '<div class="ubr_f">Получить реверс данного заказа невозможно. Он был оплачен через Uniteller</div>';
}
} else {
$out = '<div class="ubr_f">Получить реверс данного заказа невозможно, он не был оплачен, либо его не существует</div>';
}
}
break;
case '4':
if (!empty($_POST["VALUE2_ID_1"]) and !empty($_POST["VALUE2_SERT_1"])) {
$bankHandler = new Ubrir(array('shopId' => $_POST["VALUE2_ID_1"], 'sert' => $_POST["VALUE2_SERT_1"]));
$out = $bankHandler->reconcile();
示例12: array
if($response->getTrackingId() == $tracking_id) {
$arOrder = CSaleOrder::GetByID($order_id);
$message = array();
$message []= Loc::getMessage("SALE_BEGATEWAY_STATUS_MESSAGE_UID") . ' ' . $response->getUid(). ". " . Loc::getMessage("SALE_BEGATEWAY_STATUS_MESSAGE_TIME") . ' ' . $response->getResponse()->transaction->paid_at;
if(isset($response->getResponse()->transaction->three_d_secure_verification->pa_status)) {
$message[] = "3-D Secure: " .$response->getResponse()->transaction->three_d_secure_verification->pa_status;
}
$arFields = array(
"PS_STATUS" => ($response->isSuccess() ? "Y" : "N"),
"PS_STATUS_DESCRIPTION" => implode("\n",$message),
"PS_SUM" => $money->getAmount(),
"PS_CURRENCY" => $money->getCurrency(),
"PS_RESPONSE_DATE" => new \Bitrix\Main\Type\DateTime(),
"USER_ID" => $arOrder["USER_ID"]
);
if (CSalePaySystemAction::GetParamValue("PAYED") != "Y" &&
$arFields["PS_STATUS"] == "Y" &&
$arOrder["PRICE"] == $money->getAmount()) {
CSaleOrder::PayOrder($arOrder["ID"], "Y", True, True, 0, $arFields);
CSaleOrder::StatusOrder($arOrder["ID"], "P");
}
return true;
}
}
return false;
示例13: getInput
function getInput()
{
$mname = dirname("../..");
$task_ubrir = JRequest::getVar('task_ubrir');
$shoporderidforstatus = JRequest::getVar('shoporderidforstatus');
$VALUE2_ID_1 = JRequest::getVar('VALUE2_ID_1');
$VALUE2_SERT_1 = JRequest::getVar('VALUE2_SERT_1');
$VALUE2_UNI_LOGIN_1 = JRequest::getVar('VALUE2_UNI_LOGIN_1');
$VALUE2_UNI_EMP_1 = JRequest::getVar('VALUE2_UNI_EMP_1');
if (!empty($task_ubrir)) {
switch ($task_ubrir) {
case '1':
if (!empty($shoporderidforstatus) and !empty($VALUE2_ID_1) and !empty($VALUE2_SERT_1)) {
$order_id = $shoporderidforstatus;
$conf = new JConfig();
$db_conn = new mysqli($conf->host, $conf->user, $conf->password, $conf->db);
if (mysqli_connect_errno()) {
printf("Ошибка доступа к БД: %s\n", mysqli_connect_error());
exit;
}
$answer = $db_conn->query('SELECT * FROM ' . $conf->dbprefix . 'virtuemart_payment_plg_' . $mname . ' WHERE virtuemart_order_id="' . $order_id . '"')->fetch_assoc();
if (!empty($arOrder['PS_STATUS_MESSAGE'])) {
$bankHandler = new Ubrir(array('shopId' => $VALUE2_ID_1, 'order_id' => $order_id, 'sert' => $VALUE2_SERT_1, 'twpg_order_id' => $answer['order_number'], 'twpg_session_id' => $answer['session_id']));
$out = '<div class="ubr_s">Статус заказа - ' . $bankHandler->check_status() . '</div>';
} else {
$out = '<div class="ubr_f">Получить статус данного заказа невозможно. Либо его не существует, либо он был оплачен через Uniteller</div>';
}
}
break;
case '2':
if (!empty($shoporderidforstatus) and !empty($VALUE2_ID_1) and !empty($VALUE2_SERT_1)) {
$order_id = $shoporderidforstatus * 1;
$arOrder = CSaleOrder::GetByID($order_id);
if (!empty($arOrder['PS_STATUS_MESSAGE'])) {
$bankHandler = new Ubrir(array('shopId' => $VALUE2_ID_1, 'order_id' => $order_id, 'sert' => $VALUE2_SERT_1, 'twpg_order_id' => $arOrder['PS_STATUS_DESCRIPTION'], 'twpg_session_id' => $arOrder['PS_STATUS_MESSAGE']));
$out = $bankHandler->detailed_status();
} else {
$out = '<div class="ubr_f">Получить детализацию данного заказа невозможно. Либо его не существует, либо он был оплачен через Uniteller</div>';
}
}
break;
case '3':
if (!empty($shoporderidforstatus) and !empty($VALUE2_ID_1) and !empty($VALUE2_SERT_1)) {
$order_id = $shoporderidforstatus * 1;
$arOrder = CSaleOrder::GetByID($order_id);
if ($arOrder['PAYED'] == 'Y') {
if (!empty($arOrder['PS_STATUS_MESSAGE'])) {
$bankHandler = new Ubrir(array('shopId' => $VALUE2_ID_1, 'order_id' => $order_id, 'sert' => $VALUE2_SERT_1, 'twpg_order_id' => $arOrder['PS_STATUS_DESCRIPTION'], 'twpg_session_id' => $arOrder['PS_STATUS_MESSAGE']));
$res = $bankHandler->reverse_order();
if ($res == 'OK') {
$out = '<div class="ubr_s">Оплата успешно отменена</div>';
CSaleOrder::Update($order_id, array("PAYED" => "N"));
CSaleOrder::StatusOrder($order_id, "N");
} else {
$out = $res;
}
} else {
$out = '<div class="ubr_f">Получить реверс данного заказа невозможно. Он был оплачен через Uniteller</div>';
}
} else {
$out = '<div class="ubr_f">Получить реверс данного заказа невозможно, он не был оплачен, либо его не существует</div>';
}
}
break;
case '4':
if (!empty($VALUE2_ID_1) and !empty($VALUE2_SERT_1)) {
$bankHandler = new Ubrir(array('shopId' => $VALUE2_ID_1, 'sert' => $VALUE2_SERT_1));
$out = $bankHandler->reconcile();
}
break;
case '5':
if (!empty($VALUE2_ID_1) and !empty($VALUE2_SERT_1)) {
$bankHandler = new Ubrir(array('shopId' => $VALUE2_ID_1, 'sert' => $VALUE2_SERT_1));
$out = $bankHandler->extract_journal();
}
break;
case '6':
if (!empty($VALUE2_UNI_LOGIN_1) and !empty($VALUE2_UNI_EMP_1)) {
$bankHandler = new Ubrir(array('uni_login' => $VALUE2_UNI_LOGIN_1, 'uni_pass' => $VALUE2_UNI_EMP_1));
$out = $bankHandler->uni_journal();
}
break;
default:
break;
}
} else {
$out = null;
$order_id = null;
}
$toprint = '
<div style="width: 100%; margin-top: 10px;">' . $out . '</div>
<div style="margin: 20px 0 20px 0; text-align: center; padding: 20px; width: 415px; border: 1px dashed #999;">
<h3 style="text-align: center; padding: 0 0 20px 0; margin: 0;">Получить детальную информацию:</h3>
<div style="margin: 0 auto; text-align: center; padding: 5px; width: 200px; border: 1px dashed #999;">Номер заказа: <br>
<input style="margin: 5px;" type="text" name="shoporderidforstatus" id="shoporderidforstatus" value="' . $order_id . '" placeholder="№ заказа" size="8">
<input style="margin: 5px;" type="hidden" name="task_ubrir" id="task_ubrir" value="">
<input class="twpginput" type="button" onclick="jQuery(\'#task_ubrir\').val(1); submit();" id="statusbutton" value="Запросить статус">
<input class="twpginput" type="button" onclick="jQuery(\'#task_ubrir\').val(2); submit();" id="detailstatusbutton" value="Детальная информация">
<input class="twpginput" type="button" onclick="jQuery(\'#task_ubrir\').val(3); submit();" id="reversbutton" value="Вернуть деньги"><br>
</div>
//.........这里部分代码省略.........
示例14: mapYandexStatusToOrder
protected function mapYandexStatusToOrder($order, $yandexStatus, $cancelReason = "")
{
global $APPLICATION;
if (!is_array($order) || !isset($order["ID"]) || strlen($yandexStatus) <= 0) {
return false;
}
$settings = $this->getSettingsBySiteId($order["LID"]);
if (!isset($settings["STATUS_IN"][$yandexStatus]) || strlen($settings["STATUS_IN"][$yandexStatus]) <= 0) {
return false;
}
$result = false;
$bitrixStatus = $settings["STATUS_IN"][$yandexStatus];
switch ($bitrixStatus) {
/* flags */
case "CANCELED":
$errorMessageTmp = "";
$result = CSaleOrder::CancelOrder($order["ID"], "Y", $cancelReason);
if (!$result) {
if ($ex = $APPLICATION->GetException()) {
if ($ex->GetID() != "ALREADY_FLAG") {
$errorMessageTmp .= $ex->GetString();
}
} else {
$errorMessageTmp .= GetMessage("ERROR_CANCEL_ORDER") . ". ";
}
}
if ($errorMessageTmp != "") {
$this->log(self::LOG_LEVEL_ERROR, "YMARKET_INCOMING_ORDER_STATUS", $order["XML_ID"], $errorMessageTmp);
} else {
$this->log(self::LOG_LEVEL_INFO, "YMARKET_INCOMING_ORDER_STATUS", $order["XML_ID"], GetMessage("SALE_YMH_INCOMING_ORDER_STATUS_CANCELED") . ": " . $order["ID"]);
}
break;
case "ALLOW_DELIVERY":
$result = CSaleOrder::DeliverOrder($order["ID"], "Y");
break;
case "PAYED":
$result = CSaleOrder::PayOrder($order["ID"], "Y");
break;
case "DEDUCTED":
$result = CSaleOrder::DeductOrder($order["ID"], "Y");
break;
/* statuses */
/* statuses */
default:
if (CSaleStatus::GetByID($bitrixStatus)) {
$result = CSaleOrder::StatusOrder($order["ID"], $bitrixStatus);
}
break;
}
$this->log($result ? self::LOG_LEVEL_INFO : self::LOG_LEVEL_ERROR, "YMARKET_ORDER_STATUS_CHANGE", $order["ID"], ($result ? GetMessage("SALE_YMH_LOG_TYPE_ORDER_STATUS_CHANGE_OK") : GetMessage("SALE_YMH_LOG_TYPE_ORDER_STATUS_CHANGE_ERROR")) . " (" . $bitrixStatus . ")");
return $result;
}
示例15: OnPayads
/**
* @param $id ID заказа
* @param $val статус оплаты Y или N
* функция после подтверждения оплаты
* изменяет статус объявления на VIP
*/
function OnPayads($id,$val)
{
// Если оплата Y
if($val == 'Y')
{
//SendEmailPartnerByOrder($id, "SALE_ORDER_PAIDPARTNER");
$dbBasketItems = CSaleBasket::GetList(
array("PRICE" => "DESC"),
array(
"ORDER_ID" => $id
),
false,
false,
array("ID", "NAME")
);
while ($arBasketItems = $dbBasketItems->Fetch())
{
$dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arBasketItems["ID"]));
if($arProp = $dbProp -> GetNext())
{
$dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arBasketItems["ID"]));
if($arProp = $dbProp -> GetNext())
{
if($arProp['CODE']=='TEST_VIP'){
$status_true=true;
$ELEMENT_ID = intval($arProp['VALUE']);
$PROPERTY_CODE = "VIPORDERCHECK";
$PROPERTY_VALUE = "Y";
if (CModule::IncludeModule("iblock"))
CIBlockElement::SetPropertyValuesEx($ELEMENT_ID, false, array($PROPERTY_CODE => $PROPERTY_VALUE));
}
if($arProp['CODE']=='TEST_ADSUP'){
$status_true=true;
$ELEMENT_ID = intval($arProp['VALUE']);
$PROPERTY_CODE = "ADSUP";
$PROPERTY_VALUE = "Y";
if (CModule::IncludeModule("iblock")){
//CIBlockElement::SetPropertyValuesEx($ELEMENT_ID, false, array($PROPERTY_CODE => $PROPERTY_VALUE));
$el = new CIBlockElement;
$el->Update($ELEMENT_ID, Array('TIMESTAMP_X' => true,"ACTIVE_FROM"=>date("d.m.Y H:i:s")));
}
}
}
}
}
if($status_true){
CSaleOrder::StatusOrder($id, "Y");
}else{
CSaleOrder::StatusOrder($id, "P");
}
}
}