Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class retentional_api
- {
- public $APIKEY = 'f5de8340b4228cb411a2326f0c171b65'; // Your API key
- public function send($get=null, $post=null)
- {
- $ch = curl_init();
- $url = 'http://retentionpanel.com/retentional_api.php';
- if(!is_null($get) && $get!='')$url .= '?'.$get;
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
- curl_setopt($ch, CURLOPT_TIMEOUT, 20);
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_POST, true);
- if(is_array($post))
- {
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- $result = curl_exec($ch);
- if (curl_errno($ch) != 0 && empty($result)) $result = false;
- curl_close($ch);
- return $result;
- }
- public function add_order($link, $serviceid, $quantity)
- {
- return $this->send(null, array('apikey' => $this->APIKEY, 'action' =>'add',
- 'serviceid' => $serviceid, 'url' => $link, 'qty' => $quantity ));
- }
- public function get_order_status($order_id)
- {
- return $this->send('apikey='.$this->APIKEY.'&order='.$order_id);
- }
- }
- $api = new retentional_api();
- $order = $api->add_order('https://www.youtube.com/watch?v=5N07RsAdOxs','2','100');
- $a =json_decode($order, true);
- $orderid = $a['orderid'];
- print "Order id: ".$orderid;
- print "Massage: ".$a['msg'];
- print "Order Status: ".$a['status'];
- print "Order start_count: ".$a['start_count'];
- print "Order amount: ".$a['amount'];
- $api = new retentional_api();
- $order_info = $api->get_order_status($orderid);
- $order_info =json_decode($order_info, true);
- echo "here is ur order status";
- *******************
- print "Order Status: ".$order_info['status'];
- print "Order start_count: ".$order_info['start_count'];
- print "Order amount: ".$order_info['amount'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement