%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 3.142.114.199 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/ru/payment/yandex/ |
Upload File : |
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?><? $orderIsPaid = $_POST["orderIsPaid"]; $orderSumAmount = $_POST["orderSumAmount"]; $orderSumCurrencyPaycash = $_POST["orderSumCurrencyPaycash"]; $orderSumBankPaycash = $_POST["orderSumBankPaycash"]; $action = $_POST["action"]; $orderCreatedDatetime = $_POST["orderCreatedDatetime"]; $paymentType = $_POST["paymentType"]; $customerNumber = intval($_POST["customerNumber"]); $invoiceId = $_POST["invoiceId"]; $md5 = $_POST["md5"]; $paymentDateTime = $_POST["paymentDateTime"]; $bCorrectPayment = True; if(!($arOrder = CSaleOrder::GetByID($customerNumber))) { $bCorrectPayment = False; $code = "200"; //неверные параметры $techMessage = "ID заказа неизвестен."; } if ($bCorrectPayment) CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]); $Sum = CSalePaySystemAction::GetParamValue("SHOULD_PAY"); $Sum = number_format($Sum, 2, ',', ''); $shopId = CSalePaySystemAction::GetParamValue("SHOP_ID"); $scid = CSalePaySystemAction::GetParamValue("SCID"); $customerNumber = CSalePaySystemAction::GetParamValue("ORDER_ID"); $changePayStatus = trim(CSalePaySystemAction::GetParamValue("CHANGE_STATUS_PAY")); $shopPassword = CSalePaySystemAction::GetParamValue("SHOP_KEY"); if($shopPassword == '') $bCorrectPayment = False; $strCheck = md5(implode(";", array($orderIsPaid, $orderSumAmount, $orderSumCurrencyPaycash, $orderSumBankPaycash, $shopId, $invoiceId, $customerNumber, $shopPassword))); if ($bCorrectPayment && ToUpper($md5) != ToUpper($strCheck)) { $bCorrectPayment = False; $code = "1"; // ошибка авторизации } if($bCorrectPayment) { if($action=="Check") { if(DoubleVal($arOrder["PRICE"]) == DoubleVal($orderSumAmount)) $code = "0"; else { $code = "100"; //неверные параметры $techMessage = "Сумма заказа не верна."; } } elseif($action=="PaymentSuccess") { $strPS_STATUS_DESCRIPTION = ""; $strPS_STATUS_DESCRIPTION .= "номер плательщика - ".$customerNumber."; "; $strPS_STATUS_DESCRIPTION .= "дата платежа - ".$paymentDateTime."; "; $strPS_STATUS_DESCRIPTION .= "код подтверждения платежа - ".$orderIsPaid."; "; $strPS_STATUS_MESSAGE = ""; $arFields = array( "PS_STATUS" => "Y", "PS_STATUS_CODE" => mb_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($techMessage == '' && $code == '') $code = "0"; } else { $code = "200"; //неверные параметры $techMessage = "Не известен тип запроса."; } } $APPLICATION->RestartBuffer(); $dateISO = date("Y-m-d\TH:i:s").mb_substr(date("O"), 0, 3).":".mb_substr(date("O"), -2, 2); header("Content-Type: text/xml"); header("Pragma: no-cache"); $text = "<"."?xml version=\"1.0\" encoding=\"windows-1251\"?".">\n"; $text .= "<response performedDatetime=\"".$dateISO."\">"; if($techMessage <> '') $text .= "<result code=\"".$code."\" action=\"".htmlspecialcharsbx($action)."\" shopId=\"".$shopId."\" invoiceId=\"".htmlspecialcharsbx($invoiceId)."\" techMessage=\"".$techMessage."\"/>"; else $text .= "<result code=\"".$code."\" action=\"".htmlspecialcharsbx($action)."\" shopId=\"".$shopId."\" invoiceId=\"".htmlspecialcharsbx($invoiceId)."\"/>"; $text .= "</response>"; echo $text; die(); ?>