1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
result_rec.php
См. документацию.
1<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?><?
2
3$orderIsPaid = $_POST["orderIsPaid"];
4$orderSumAmount = $_POST["orderSumAmount"];
5$orderSumCurrencyPaycash = $_POST["orderSumCurrencyPaycash"];
6$orderSumBankPaycash = $_POST["orderSumBankPaycash"];
7$action = $_POST["action"];
8$orderCreatedDatetime = $_POST["orderCreatedDatetime"];
9$paymentType = $_POST["paymentType"];
10$customerNumber = intval($_POST["customerNumber"]);
11$invoiceId = $_POST["invoiceId"];
12$md5 = $_POST["md5"];
13$paymentDateTime = $_POST["paymentDateTime"];
14
16if(!($arOrder = CSaleOrder::GetByID($customerNumber)))
17{
18 $bCorrectPayment = False;
19 $code = "200"; //неверные параметры
20 $techMessage = "ID заказа неизвестен.";
21}
22
24 CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]);
25
27$Sum = number_format($Sum, 2, ',', '');
33
34if($shopPassword == '')
35 $bCorrectPayment = False;
36
38
40{
41 $bCorrectPayment = False;
42 $code = "1"; // ошибка авторизации
43}
44
46{
47 if($action=="Check")
48 {
49 if(DoubleVal($arOrder["PRICE"]) == DoubleVal($orderSumAmount))
50 $code = "0";
51 else
52 {
53 $code = "100"; //неверные параметры
54 $techMessage = "Сумма заказа не верна.";
55 }
56 }
57 elseif($action=="PaymentSuccess")
58 {
59 $strPS_STATUS_DESCRIPTION = "";
60 $strPS_STATUS_DESCRIPTION .= "номер плательщика - ".$customerNumber."; ";
61 $strPS_STATUS_DESCRIPTION .= "дата платежа - ".$paymentDateTime."; ";
62 $strPS_STATUS_DESCRIPTION .= "код подтверждения платежа - ".$orderIsPaid."; ";
63 $strPS_STATUS_MESSAGE = "";
64
66 "PS_STATUS" => "Y",
67 "PS_STATUS_CODE" => mb_substr($action, 0, 5),
68 "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION,
69 "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE,
70 "PS_SUM" => $orderSumAmount,
71 "PS_CURRENCY" => $orderSumCurrencyPaycash,
72 "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))),
73 );
74
75 // You can comment this code if you want PAYED flag not to be set automatically
76 if (FloatVal($arOrder["PRICE"]) == FloatVal($orderSumAmount) && intval($orderIsPaid) == 1)
77 {
78 if ($changePayStatus == "Y")
79 {
80 if($arOrder["PAYED"] == "Y")
81 $code = "0";
82 else
83 {
84 if (!CSaleOrder::PayOrder($arOrder["ID"], "Y", true, true))
85 {
86 $code = "1000";
87 $techMessage = "Ошибка оплаты заказа.";
88 }
89 else
90 $code = "0";
91 }
92 }
93 }
94 else
95 {
96 $code = "200"; //неверные параметры
97 $techMessage = "Сумма заказа не верна.";
98 }
99
100 if(CSaleOrder::Update($arOrder["ID"], $arFields))
101 if($techMessage == '' && $code == '')
102 $code = "0";
103 }
104 else
105 {
106 $code = "200"; //неверные параметры
107 $techMessage = "Не известен тип запроса.";
108 }
109}
110
111$APPLICATION->RestartBuffer();
112$dateISO = date("Y-m-d\TH:i:s").mb_substr(date("O"), 0, 3).":".mb_substr(date("O"), -2, 2);
113header("Content-Type: text/xml");
114header("Pragma: no-cache");
115$text = "<"."?xml version=\"1.0\" encoding=\"windows-1251\"?".">\n";
116$text .= "<response performedDatetime=\"".$dateISO."\">";
117if($techMessage <> '')
118 $text .= "<result code=\"".$code."\" action=\"".htmlspecialcharsbx($action)."\" shopId=\"".$shopId."\" invoiceId=\"".htmlspecialcharsbx($invoiceId)."\" techMessage=\"".$techMessage."\"/>";
119else
120 $text .= "<result code=\"".$code."\" action=\"".htmlspecialcharsbx($action)."\" shopId=\"".$shopId."\" invoiceId=\"".htmlspecialcharsbx($invoiceId)."\"/>";
121$text .= "</response>";
122echo $text;
123die();
124?>
global $APPLICATION
Определения include.php:80
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
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
ToUpper($str)
Определения tools.php:2247
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
die
Определения quickway.php:367
$text
Определения template_pdf.php:79
$shopId
Определения refund.php:14
$Sum
Определения payment.php:2
$scid
Определения payment.php:4
$customerNumber
Определения payment.php:5
$md5
Определения result_rec.php:12
$paymentDateTime
Определения result_rec.php:13
$bCorrectPayment
Определения result_rec.php:15
$orderSumBankPaycash
Определения result_rec.php:6
$dateISO
Определения result_rec.php:112
$paymentType
Определения result_rec.php:9
$orderSumAmount
Определения result_rec.php:4
$orderCreatedDatetime
Определения result_rec.php:8
$invoiceId
Определения result_rec.php:11
$shopPassword
Определения result_rec.php:32
$orderIsPaid
Определения result_rec.php:3
$orderSumCurrencyPaycash
Определения result_rec.php:5
$strCheck
Определения result_rec.php:37
$changePayStatus
Определения result.php:13
$action
Определения file_dialog.php:21