Файл: _rootinc/netcardaz.inc.php
Строк: 22
<?
class NETCARDAZ
{
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,$desc)
{
$result = $this->send("http://wap.netcard.az/?/aze/check/".$partner_id."/".$card_number."/".$desc."/");
if ($result) {
if ($result[0]) {
return $result[1];
} else {
$this->error = "check: ".$result[1];
return false;
}
}
else {
$this->error = "check: No output";
return false;
}
}
}
?>