19 file_put_contents(__DIR__ .
"/log.txt",
$data, FILE_APPEND);
22if(!function_exists(
"qiwiWalletGetAuthHeader"))
24 function qiwiWalletGetAuthHeader()
26 $incomingToken =
false;
28 $incomingToken =
$_SERVER[
"REMOTE_USER"];
30 $incomingToken =
$_SERVER[
"REDIRECT_REMOTE_USER"];
32 $incomingToken =
$_SERVER[
"HTTP_AUTHORIZATION"];
33 elseif(function_exists(
"apache_request_headers"))
35 $headers = \apache_request_headers();
37 if(array_key_exists(
"Authorization", $headers))
38 $incomingToken = $headers[
"Authorization"];
40 return $incomingToken;
44if(!function_exists(
"qiwiWalletCheckAuth"))
51 $header = qiwiWalletGetAuthHeader();
56 $check =
"Basic " . base64_encode(
"{$login}:{$password}");
57 return $header == $check;
61if(!function_exists(
"qiwiWalletXmlResponse"))
63 function qiwiWalletXmlResponse(
$code)
67 header(
"Content-Type: text/xml");
68 header(
"Pragma: no-cache");
69 $xml =
'<?xml version="1.0" encoding="UTF-8"?><result><result_code>' .
$code .
'</result_code></result>';
70 $siteCharset = Application::getInstance()->getContext()->getCulture()->getCharset();
71 print \CharsetConverter::getInstance()->ConvertCharset($xml, $siteCharset,
"utf-8");
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)