php class FakeAPI public static function run en false en_api https www

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
class FakeAPI {
public static function run($en = false) {
$en_api = 'https://www.portmone.com.ua/r3/en/api/index/index/uid/d75c995c18fdc7b4b4f1217669138944';
$ru_api = 'https://www.portmone.com.ua/r3/ru/api/index/index/uid/d75c995c18fdc7b4b4f1217669138944';
$log = 'portmone.log';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_URL => $en ? $en_api : $ru_api,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => file_get_contents('php://input')
));
$res = curl_exec($ch);
$fp = fopen($log, 'a+');
fwrite($fp, $res . "\n\n\n");
fclose($fp);
echo $res;
curl_close($ch);
}
}