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 include(GetLangFileName(dirname(__FILE__)."/", "/result_rec.php"));
5
6 $cs1 = intval($_POST["order_id"]);
7 if($cs1 <= 0)
8 $cs1 = intval($_POST["cs1"]);
9 $bCorrectPayment = True;
10 $techMessage = "";
11 if(!($arOrder = CSaleOrder::GetByID($cs1)))
12 {
13 $bCorrectPayment = False;
14 $techMessage = GetMessage("SALE_CHR_REC_ORDER");
15 }
16
18 CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]);
19
20 $sharedsecB = CSalePaySystemAction::GetParamValue("SHARED");
21
22 if($sharedsecB == '')
23 $bCorrectPayment = False;
24
26 {
27 $productIdB = CSalePaySystemAction::GetParamValue("PRODUCT_ID");
28 $orderIdB = CSalePaySystemAction::GetParamValue("ORDER_ID");
29 $product_priceB = number_format(CSalePaySystemAction::GetParamValue("SHOULD_PAY"), 2, '.', '');
30
31 $product_id = trim($_POST["product_id"]);
32 $customer_id = trim($_POST["customer_id"]);
33 $transaction_id = trim($_POST["transaction_id"]);
34 $transaction_type = trim($_POST["transaction_type"]);
35 $total = trim($_POST["total"]);
36 $currency = trim($_POST["currency"]);
37 $date = trim($_POST["date"]);
38 $sign = trim($_POST["sign"]);
39
40 if($product_id == $productIdB)
41 {
42 $checkB = md5($sharedsecB.$customer_id.$transaction_id.$transaction_type.$total);
43 if($checkB == $sign)
44 {
45 if($transaction_type == "onetime" || $transaction_type == "Purchase")
46 {
47 if($product_priceB == $total)
48 {
49
50 if($arOrder["PAYED"] != "Y")
51 CSaleOrder::PayOrder($arOrder["ID"], "Y");
52 }
53 else
54 $techMessage = GetMessage("SALE_CHR_REC_SUMM");
55 }
56 else
57 $techMessage = GetMessage("SALE_CHR_REC_TRANS");
58 }
59 else
60 $techMessage = GetMessage("SALE_CHR_REC_SIGN");
61 }
62 else
63 $techMessage = GetMessage("SALE_CHR_REC_PRODUCT");
64
65 $strPS_STATUS_DESCRIPTION = "Customer id: ".$customer_id.";<br />";
66 $strPS_STATUS_DESCRIPTION .= "Transaction id: ".$transaction_id.";<br />";
67 $strPS_STATUS_DESCRIPTION .= "Date payed: ".$date.";<br />";
68 $strPS_STATUS_DESCRIPTION .= "Payment type: ".$_POST["payment_type"].";<br />".
69 "Buyer: ".$_POST["name"].";<br />".
70 "Email: ".$_POST["email"].";<br />".
71 "Country: ".$_POST["country"].";<br />".
72 "City: ".$APPLICATION->ConvertCharset($_POST["city"], "utf-8", SITE_CHARSET).";<br />".
73 "Street: ".$APPLICATION->ConvertCharset($_POST["street"], "utf-8", SITE_CHARSET).";<br />".
74 "Phone: ".$_POST["phone"].";<br />".
75 "Index: ".$_POST["zip"].";<br />";
76
78 "PS_STATUS" => ($transaction_type == "onetime" || $transaction_type == "Purchase") ? "Y" : "N",
79 "PS_STATUS_CODE" => $transaction_type,
80 "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION,
81 "PS_STATUS_MESSAGE" => $techMessage,
82 "PS_SUM" => $total,
83 "PS_CURRENCY" => $currency,
84 "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))),
85 );
86
87 CSaleOrder::Update($arOrder["ID"], $arFields);
88 }
89}
90?>
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
const SITE_CHARSET
Определения include.php:62
GetMessage($name, $aReplace=null)
Определения tools.php:3397
GetLangFileName($before, $after, $lang=false)
Определения tools.php:3428
$sign
Определения payment.php:69
die
Определения quickway.php:367
$bCorrectPayment
Определения result_rec.php:15
$currency
Определения template.php:266