<?php
$qryApi = mysqli_query($conn,"SELECT * FROM api_setting");
$apidata = mysqli_fetch_array($qryApi);

$apikey = $apidata['APIkey']; //email address()
$url = $apidata['baseurl'];

$message = utf8_encode($customer);
$Customer2 = urlencode($message);

$host = "https://vtuafrica.com.ng/portal/api/smile?apikey=$apikey&service=$network&accountNo=$iuc&variation=$variation_code&amount=$xamount&phone=$phone&ref=$requestId";


//https://vtuafrica.com.ng/portal/api/smile?apikey=$apikey&service=smile-direct&accountNo=2009009815&variation=smile1&amount=100&phone=2347020823606&ref=$requestId



//Initialize cURL.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$dataR = curl_exec($ch);
$result = json_decode($dataR);

//Close the cURL handle.
curl_close($ch);


$resp = json_decode($dataR);

?>