1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
result.php
См. документацию.
1<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
2
6
7Loc::loadLanguageFile(Path::combine(__DIR__, "statuses.php"));
8
9$orderID = CSalePaySystemAction::GetParamValue("ORDER_ID") <> '' ? CSalePaySystemAction::GetParamValue("ORDER_ID") : $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ID"];
14$statusUrl = "https://w.qiwi.com/api/v2/prv/{prv_id}/bills/{bill_id}";
15
16$request = new HttpClient();
17$request->setAuthorization($login, $password);
18$request->setHeader("Accept", "text/json");
19$request->setCharset("utf-8");
20
21$response = $request->get(str_replace(
22 array("{prv_id}", "{bill_id}"),
25));
26
27if($response === false)
28 return 1;
29
30$response = (array)json_decode($response);
31if(!$response || !isset($response['response']))
32 return 1;
33$response = (array)$response['response'];
34
35if((int)$response['result_code'])
36{
38 "PS_STATUS" => "N",
39 "PS_STATUS_CODE" => $response['result_code'],
40 "PS_STATUS_MESSAGE" => Loc::getMessage("SALE_QWH_ERROR_CODE_" . $response['result_code']),
41 "PS_STATUS_DESCRIPTION" => isset($response['description']) ? $response['description'] : "",
42 "PS_RESPONSE_DATE" => \Bitrix\Main\Type\DateTime::createFromTimestamp(time())
43 ));
44}
45elseif(isset($response['bill']))
46{
47 $bill = (array)$response['bill'];
48
49 if($order = CSaleOrder::getByID($bill['bill_id']))
50 {
51 $paidInfo = array(
52 "PS_STATUS" => $bill['status'] == "paid" ? "Y" : "N",
53 "PS_STATUS_CODE" => mb_substr($bill['status'], 0, 10),
54 "PS_STATUS_MESSAGE" => Loc::getMessage("SALE_QWH_STATUS_MESSAGE_".mb_strtoupper($bill['status'])),
55 "PS_RESPONSE_DATE" => \Bitrix\Main\Type\DateTime::createFromTimestamp(time()),
56 "PS_SUM" => (double)$bill['amount'],
57 "PS_CURRENCY" => $bill['ccy'],
58 'PS_STATUS_DESCRIPTION' => ''
59 );
60
61 foreach($bill as $key => $value)
62 $paidInfo['PS_STATUS_DESCRIPTION'] .= "{$key}:{$value}, ";
63
64 CSaleOrder::Update($orderID, $paidInfo);
65
66 if($bill['status'] == "paid" && (double)$bill['amount'] == (double)$order['PRICE'] && $changePayStatus)
67 {
68 CSaleOrder::payOrder($orderID, "Y", true, true);
69 }
70 }
71}
72?>
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
$login
Определения change_password.php:8
Определения path.php:12
static GetParamValue($key, $defaultValue=null)
Определения pay_system_action.php:76
static Update($ID, $arFields, $bDateUpdate=true)
Определения order.php:140
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$order
Определения payment.php:8
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($signedUserToken)) $key
Определения quickway.php:257
die
Определения quickway.php:367
$shopId
Определения refund.php:14
$password
Определения result.php:7
$statusUrl
Определения result.php:14
$changePayStatus
Определения result.php:13
$orderID
Определения result.php:9
$response
Определения result.php:21
$GLOBALS['_____370096793']
Определения update_client.php:1