<?php 
	session_start();
	header("Access-Control-Allow-Origin: *");
	/*$message=array();
	$message['msisdn']=22997977578;//$_POST['msisdn'];
	$message['amount']=1;//$_POST['amount'];
	$message['firstname']="Tahirou";//$_POST['firstname'];
	$message['lastname']="DJARA";//$_POST['lastname'];
	$message['transref']=time();
	$message['clientid']='UBHQ';//$_POST['clientid']; 
	$message['comment']="null";

	$username = "USR06";  
	$password = "YG739G5XFVPYYV4ADJVW";*/  
 
	//////////////////////////////////////////////////////////
	function callRequestpayment($method, $url, $data, $username, $password){
		$curl = curl_init();
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
		switch ($method){
			case "POST":
				curl_setopt($curl, CURLOPT_POST, 1);
				if ($data)
					curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
				break;
			case "PUT":
				curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
				if ($data)
					curl_setopt($curl, CURLOPT_POSTFIELDS, $data);                         
				break;
			default:
				if ($data)
					$url = sprintf("%s?%s", $url, http_build_query($data));
		}
	   // OPTIONS:
	   curl_setopt($curl, CURLOPT_URL, $url);
	   curl_setopt($curl, CURLOPT_HTTPHEADER, array(
		  //'APIKEY: 111111111111111111111',
		  'Content-Type: application/json',
		  'Authorization: Basic '. base64_encode("$username:$password")
	   ));
	   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
	   curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
	   // EXECUTE:
	   $result = curl_exec($curl);
	   if(!$result){die("Connection Failure...");}
	   curl_close($curl);
	   return $result;
	}
	////////////////////////////////////////////////////////////////////////////////
	/*$make_call = callRequestpayment(
		'POST',
		"http://74.208.84.251:8221/QosicBridge/user/requestpayment",
		json_encode($message),
		 $username,
		 $password
 	);

	$response = json_decode($make_call, true);
	/////////////////////////////////////////////////////////////////

	$_SESSION['transref']=$response['transref'];
	$_SESSION['clientid']=$message['clientid'];*/
?>