<?php
$cookie_file = "cookie.data";
$oCURL = curl_init( 'https://w.qiwi.com/'.$sPath );
curl_setopt_array( $oCURL, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_REFERER => "https://w.qiwi.com/payment/main.action",
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0',
CURLOPT_HTTPHEADER => array(
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Content-Type' => 'application/x-www-form-urlencoded; charset=windows-1251'
),
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_COOKIEJAR => $cookie_file,
CURLOPT_COOKIEFILE => $cookie_file
) );
if( !is_null( $mPOST ) )
curl_setopt_array( $oCURL, array(
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => is_array( $mPOST ) ? http_build_query( $mPOST ) : $mPOST,
) );
if( count( $aOptions ) )
curl_setopt_array( $oCURL, $aOptions );
$sResponse = curl_exec( $oCURL );
if( $sResponse === false || curl_errno( $oCURL ) != 0 )
throw new Exception( curl_error( $oCURL ), curl_errno( $oCURL ) );
curl_close( $oCURL );
print_r($sResponse);
return $sResponse;
}
private static function parseCookies( $sXML ) {
$aCookies = array();
preg_match_all( '|Set-Cookie: (.*);|U', $sXML, $aCookies );
return implode( ';', $aCookies[1] );
}
public static function check_qiwi($qiwi_num,$qiwi_pass) {
try {
$qiwi = new QIWI($qiwi_num,$qiwi_pass);
} catch (Exception $e) {
print_r($e->getMessage());
}
return true;
}
function qiwi_pay($qiwi_num,$qiwi_pass,$bill,$price) {
$date1 = date('d.m.Y',strtotime('-2 day'));
$date2 = date('d.m.Y',strtotime('+1 day'));
$operations = $this->GetHistory($date1,$date2);
$result = false;
foreach($operations as $operation)
{
if($operation['sCurrency'] === "RUB" && floatval($operation['dAmount']) >= $price && $operation['sComment'] == $bill && $operation['sStatus'] == 'status_SUCCESS')
{
$result = $operation;
}
}
return $result;
}
}
- Output for 7.0.0
- Parse error: syntax error, unexpected '}', expecting end of file in /in/jErQe on line 31
Process exited with code 255. - Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
- Parse error: syntax error, unexpected '}' in /in/jErQe on line 31
Process exited with code 255.
preferences:
175.23 ms | 1399 KiB | 24 Q