1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
result_rec.php
См. документацию.
1<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?><?
2if ($_SERVER["REQUEST_METHOD"] == "POST")
3{
4 $bCorrectPayment = True;
5
6 if (!($arOrder = CSaleOrder::GetByID(intval($_POST["pci_wmtid"]))))
7 $bCorrectPayment = False;
8
9 $CNST_PAYEE_PURSE = CSalePaySystemAction::GetParamValue("ACC_NUMBER");
10 $CNST_SECRET_KEY = CSalePaySystemAction::GetParamValue("CNST_SECRET_KEY");
11
12 if($CNST_SECRET_KEY == '' )
13 $bCorrectPayment = False;
14
15 if($_POST["LMI_PREREQUEST"] == "1")
16 {
17
18 if(round($arOrder["PRICE"],2) == round($_POST["LMI_PAYMENT_AMOUNT"],2)
19 && $CNST_PAYEE_PURSE == $_POST["LMI_PAYEE_PURSE"])
20 {
21 $APPLICATION->RestartBuffer();
22 echo "YES";
23 die();
24 }
25 }
26 else
27 {
28
30 if (defined("SITE_SERVER_NAME"))
31 $SERVER_NAME_tmp = SITE_SERVER_NAME;
32 if ($SERVER_NAME_tmp == '')
33 $SERVER_NAME_tmp = COption::GetOptionString("main", "server_name", "");
34
35 /*
36 &purse=".$strPAYEE_PURSE;
37$strPayPath .= "&amount=".round($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SHOULD_PAY"], 2);
38$strPayPath .= "&method=POST";
39$strPayPath .= "&desc=Order_".IntVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ID"])
40*/
41
42 $strCheck = md5(
43 $_POST["pci_wmtid"].
44 $_POST["WMID"].
45 md5(ToUpper(
46 "http://".$SERVER_NAME_tmp.(CSalePaySystemAction::GetParamValue("PATH_TO_RESULT")).
47 "?ORDER_ID=".$arOrder["ID"].
48 $CNST_PAYEE_PURSE.
49 round($arOrder["PRICE"], 2).
50 "Order_".$arOrder["ID"].
52 )).
53 $_POST["pci_pursesrc"].
54 $_POST["pci_pursedest"].
55 $_POST["pci_amount"].
56 $_POST["pci_desc"].
57 $_POST["pci_datecrt"].
58 $_POST["pci_mode"].
59 md5($CNST_SECRET_KEY));
60 if ($_POST["pci_marker"] != $strCheck)
61 $bCorrectPayment = False;
62
64 {
65 $strPS_STATUS_DESCRIPTION = "";
66 if ($_POST["pci_mode"] <> '')
67 $strPS_STATUS_DESCRIPTION .= "тестовый режим, реально деньги не переводились; ";
68 $strPS_STATUS_DESCRIPTION .= "кошелек продавца - ".$_POST["pci_pursedest"]."; ";
69 $strPS_STATUS_DESCRIPTION .= "номер операции - ".$_POST["pci_wmtid"]."; ";
70 $strPS_STATUS_DESCRIPTION .= "дата платежа - ".$_POST["pci_datecrt"]."";
71
72 $strPS_STATUS_MESSAGE = "";
73 $strPS_STATUS_MESSAGE .= "кошелек покупателя - ".$_POST["pci_pursesrc"]."; ";
74 $strPS_STATUS_MESSAGE .= "WMId покупателя - ".$_POST["WMID"]."; ";
75 $strPS_STATUS_MESSAGE .= "".$_POST["pci_desc"]."";
76
78 "PS_STATUS" => "Y",
79 "PS_STATUS_CODE" => "-",
80 "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION,
81 "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE,
82 "PS_SUM" => $_POST["pci_amount"],
83 "PS_CURRENCY" => $arOrder["CURRENCY"],
84 "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))),
85 "USER_ID" => $arOrder["USER_ID"]
86 );
87
88 // You can comment this code if you want PAYED flag not to be set automatically
89 if ($arOrder["PRICE"] == $_POST["pci_amount"]
90 && $CNST_PAYEE_PURSE == $_POST["pci_pursedest"])
91 {
92 CSaleOrder::PayOrder($arOrder["ID"], "Y");
93 }
94
95 CSaleOrder::Update($arOrder["ID"], $arFields);
96 }
97 }
98}
99
100?>
global $APPLICATION
Определения include.php:80
static GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
Определения option.php:8
static GetParamValue($key, $defaultValue=null)
Определения pay_system_action.php:76
static Update($ID, $arFields, $bDateUpdate=true)
Определения order.php:140
$arFields
Определения dblapprove.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
ToUpper($str)
Определения tools.php:2247
$SERVER_NAME_tmp
Определения payment.php:17
die
Определения quickway.php:367
$bCorrectPayment
Определения result_rec.php:15
$strCheck
Определения result_rec.php:37