"Y", "PS_STATUS_CODE" => substr($action, 0, 5), "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $orderSumAmount, "PS_CURRENCY" => $orderSumCurrencyPaycash, "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 (FloatVal($arOrder["PRICE"]) == FloatVal($orderSumAmount) && IntVal($orderIsPaid) == 1) { if ($changePayStatus == "Y") { if($arOrder["PAYED"] == "Y") $code = "0"; else { if (!CSaleOrder::PayOrder($arOrder["ID"], "Y", true, true)) { $code = "1000"; $techMessage = "Ошибка оплаты заказа."; } else $code = "0"; } } } else { $code = "200"; //неверные параметры $techMessage = "Сумма заказа не верна."; } if(CSaleOrder::Update($arOrder["ID"], $arFields)) if(strlen($techMessage)<=0 && strlen($code)<=0) $code = "0"; } else { $code = "200"; //неверные параметры $techMessage = "Не известен тип запроса."; } } $APPLICATION->RestartBuffer(); $dateISO = date("Y-m-d\TH:i:s").substr(date("O"), 0, 3).":".substr(date("O"), -2, 2); header("Content-Type: text/xml"); header("Pragma: no-cache"); $text = "<"."?xml version=\"1.0\" encoding=\"windows-1251\"?".">\n"; $text .= ""; if(strlen($techMessage) > 0) $text .= ""; else $text .= ""; $text .= ""; echo $text; die(); ?>