1
b_get_info_order($params, $payload);
}
//Tạo Ä‘Æ¡n hĂ ng
//CĂ¡c request khĂ¡c báºt f12 lĂªn sẽ thấy, chỉ cần Ä‘iá»n mc, site Ä‘Ăºng lĂ Ä‘Æ°á»£c.
public function create_order($mc, $site, $payload)
{
$params['mc'] = $mc;
$params['site'] = $site;
return $this->post_request($params, $payload);
}
protected function b_get_info_order($params, $payload)
{
$params['username'] = $this->username;
$params['api_key'] = $this->api_key;
$params['site'] = 'get_info_order';
$params = http_build_query($params, null, '&');
$url = $this->base_url . "/api?" . $params;
return $this->vietnamfb_post_curl($url, $payload);
}
protected function post_request($params, $payload)
{
$params['username_api'] = $this->username;
$params['key_api'] = $this->api_key;
$params = http_build_query($params, null, '&');
$payload = http_build_query($payload, null, '&');
$url = $this->base_url . "/?" . $params;
return $this->vietnamfb_post_curl($url, $payload);
}
private function h_curl($url)
{
$headers[] = "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1";
$headers[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";
$headers[] = "Connection: keep-alive";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 80);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 80);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
private function vietnamfb_post_curl($url, $payload)
{
$headers[] = "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1";
$headers[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";
$headers[] = "Connection: keep-alive";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 80);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 80);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
}
$VietNamFB = new Vietnamfb();
// Lấy thĂ´ng tin Ä‘Æ¡n hĂ ng
$ids = '13,14';
$mc = 'phone_card';
$result = $VietNamFB->get_order_info($mc, $ids);
// echo 'what';
echo $result;
// ---------
// ---------
// ---------
// ---------
// ---------
// ---------
// ---------
// ---------
// tạo request
// $payload = [
// 'id' => '879599069697778',
// 'amount' => 50,
// 'reaction' => 'like',
// 'channel_number' => 3,
// 'speed' => 0,
// 'is_advance_filter_server1' => false,
// 'gender' => '',
// 'age_from' => '',
// 'age_to' => '',
// 'friend_from' => '',
// 'friend_to' => '',
// ];
// $mc = 'buff';
// $site = 'create';
// $result = $VietNamFB->create_order($mc, $site, $payload);
// echo $result;