Файл: _rootinc/netmoneyaz.inc.php
Строк: 25
<?
class NETMONEYAZ
{
public $error = null;
public function send($request)
{
$fp = curl_init();
curl_setopt($fp, CURLOPT_URL, $request);
curl_setopt($fp, CURL_HTTP_VERSION_1_1, 1);
curl_setopt($fp, CURLOPT_POST, 1);
curl_setopt($fp, CURLOPT_POSTFIELDS, $request);
curl_setopt($fp, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($fp, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($fp, CURLOPT_RETURNTRANSFER,1);
curl_setopt($fp, CURLOPT_TIMEOUT, 120);
$result = curl_exec($fp);
if (@curl_errno($fp)) {
$this->error = "cURL Error ".@curl_errno($fp).": ".@curl_error($fp);
return false;
}
curl_close($fp);
if ($result) {
$result = @mb_split("|",$result);
return $result;
} else {
return false;
}
}
public function check($partner_id,$card_number,$user_info)
{
$result = $this->send("http://netmoney.az/check/".$card_number."/".$partner_id."/".$user_info);
if ($result) {
if ($result[0] == "2") {
return $result[1];
} else {
$this->error = "check: ".$result[1];
return false;
}
}
else {
$this->error = "check: No output";
return false;
}
}
}
?>