1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
result_rec.php
См. документацию.
1<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?>
2<?
3if ($_SERVER["REQUEST_METHOD"] == "POST")
4{
5 include(GetLangFileName(dirname(__FILE__)."/", "/result_rec.php"));
6
7 $orderId = intval($_POST["orderId"]);
8 $bCorrectPayment = True;
9 $techMessage = "";
10 if(!($arOrder = CSaleOrder::GetByID($orderId)))
11 {
12 $bCorrectPayment = False;
13 $techMessage = GetMessage("SALE_RBK_REC_ORDER");
14 }
15 else
16 {
17 CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]);
18
19 $secretKeyB = CSalePaySystemAction::GetParamValue("SECRET_KEY");
20
21 if ($bCorrectPayment && $secretKeyB <> '')
22 {
23 $statusPay = CSalePaySystemAction::GetParamValue("CHANGE_STATUS_PAY");
24 $eshopIdB = CSalePaySystemAction::GetParamValue("ESHOP_ID");
25 $recipientAmountB = number_format(CSalePaySystemAction::GetParamValue("SHOULD_PAY"), 2, '.', '');
27
28 if ($recipientCurrencyB == "RUB")
29 $recipientCurrencyB = "RUR";
30
31 $eshopId = trim($_POST["eshopId"]);
32 $paymentId = trim($_POST["paymentId"]);
33 $serviceName = trim($_POST["serviceName"]);
34 $eshopAccount = trim($_POST["eshopAccount"]);
35 $recipientAmount = trim($_POST["recipientAmount"]);
36 $recipientCurrency = trim($_POST["recipientCurrency"]);
37 $paymentStatus = trim($_POST["paymentStatus"]);
38 $userName = trim($_POST["userName"]);
39 $userEmail = trim($_POST["userEmail"]);
40 $paymentData = trim($_POST["paymentData"]);
41 $hash = trim($_POST["hash"]);
42 $paymentAmount = trim($_POST["paymentAmount"]);
43 $paymentCurrency = trim($_POST["paymentCurrency"]);
44
45 if($eshopId == $eshopIdB)
46 {
47 $checkB = md5($eshopId."::".$orderId."::".$serviceName."::".$eshopAccount."::".$recipientAmount."::".$recipientCurrency."::".$paymentStatus."::".$userName."::".$userEmail."::".$paymentData."::".$secretKeyB);
48
49 if($checkB == $hash)
50 {
51 if($paymentStatus == 5)
52 {
53 if($recipientAmountB == $recipientAmount && $recipientCurrencyB == $recipientCurrency)
54 {
55 if($arOrder["PAYED"] != "Y" && $statusPay == "Y")
56 CSaleOrder::PayOrder($arOrder["ID"], "Y");
57
58 $techMessage = GetMessage("SALE_RBK_PROCESS_OK");
59 }
60 else
61 $techMessage = GetMessage("SALE_RBK_REC_SUMM");
62 }
63 elseif($paymentStatus == 3)
64 $techMessage = GetMessage("SALE_RBK_PROCESS_PAY");
65 else
66 $techMessage = GetMessage("SALE_RBK_REC_TRANS");
67 }
68 else
69 $techMessage = GetMessage("SALE_RBK_REC_SIGN");
70 }
71 else
72 $techMessage = GetMessage("SALE_RBK_REC_PRODUCT");
73
74 $strPS_STATUS_DESCRIPTION = GetMessage('SALE_RBK_CUSTOMER').": ".$userName." (".$userEmail."); ";
75 $strPS_STATUS_DESCRIPTION .= GetMessage('SALE_RBK_PAYMENT').": ".$paymentId."; ";
76 $strPS_STATUS_DESCRIPTION .= GetMessage('SALE_RBK_DATE').": ".$paymentData.";";
77
79 "PS_STATUS" => "Y",
80 "PS_STATUS_CODE" => $paymentStatus,
81 "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION,
82 "PS_STATUS_MESSAGE" => $techMessage,
83 "PS_SUM" => $recipientAmount,
84 "PS_CURRENCY" => $recipientCurrency,
85 "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))),
86 );
87
88 CSaleOrder::Update($arOrder["ID"], $arFields);
89 }
90 }
91}
92?>
$hash
Определения ajax_redirector.php:8
static GetParamValue($key, $defaultValue=null)
Определения pay_system_action.php:76
Определения order.php:9
$arFields
Определения dblapprove.php:5
$orderId
Определения payment.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
if(preg_match('/^ else[a-z0-9_]{2}$/i', $siteID)===1)
Определения cron_frame.php:23
GetMessage($name, $aReplace=null)
Определения tools.php:3397
GetLangFileName($before, $after, $lang=false)
Определения tools.php:3428
$recipientCurrencyB
Определения payment.php:3
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
die
Определения quickway.php:367
$bCorrectPayment
Определения result_rec.php:15
else $userName
Определения order_form.php:75