Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/sale/payment/qiwi/ |
Upload File : |
<?php use \Bitrix\Main\Application; const QIWI_WALLET_ERROR_CODE_NONE = 0; const QIWI_WALLET_ERROR_CODE_BAD_REQUEST = 5; const QIWI_WALLET_ERROR_CODE_BUSY = 13; const QIWI_WALLET_ERROR_CODE_AUTH = 150; const QIWI_WALLET_ERROR_CODE_NOT_FOUND = 210; const QIWI_WALLET_ERROR_CODE_EXISTS = 215; const QIWI_WALLET_ERROR_CODE_TOO_LOW = 241; const QIWI_WALLET_ERROR_CODE_TOO_HIGH = 242; const QIWI_WALLET_ERROR_CODE_NO_PURSE = 298; const QIWI_WALLET_ERROR_CODE_OTHER = 300; function qiwiLog($data) { file_put_contents(__DIR__ . "/log.txt", $data, FILE_APPEND); } if(!function_exists("qiwiWalletGetAuthHeader")) { function qiwiWalletGetAuthHeader() { $incomingToken = false; if(isset($_SERVER["REMOTE_USER"]) && $_SERVER["REMOTE_USER"] <> '') $incomingToken = $_SERVER["REMOTE_USER"]; elseif(isset($_SERVER["REDIRECT_REMOTE_USER"]) && $_SERVER["REDIRECT_REMOTE_USER"] <> '') $incomingToken = $_SERVER["REDIRECT_REMOTE_USER"]; elseif(isset($_SERVER["HTTP_AUTHORIZATION"]) && $_SERVER["HTTP_AUTHORIZATION"] <> '') $incomingToken = $_SERVER["HTTP_AUTHORIZATION"]; elseif(function_exists("apache_request_headers")) { $headers = \apache_request_headers(); if(array_key_exists("Authorization", $headers)) $incomingToken = $headers["Authorization"]; } return $incomingToken; } } if(!function_exists("qiwiWalletCheckAuth")) { function qiwiWalletCheckAuth($login, $password) { if($password == '') return false; $header = qiwiWalletGetAuthHeader(); if(!$header) return false; $check = "Basic " . base64_encode("{$login}:{$password}"); return $header == $check; } } if(!function_exists("qiwiWalletXmlResponse")) { function qiwiWalletXmlResponse($code) { global $APPLICATION; $APPLICATION->RestartBuffer(); header("Content-Type: text/xml"); header("Pragma: no-cache"); $xml = '<?xml version="1.0" encoding="UTF-8"?><result><result_code>' . $code . '</result_code></result>'; $siteCharset = Application::getInstance()->getContext()->getCulture()->getCharset(); print \CharsetConverter::getInstance()->ConvertCharset($xml, $siteCharset, "utf-8"); die(); } }