<?php 
ob_start();session_start();
require_once('../includes/initialize.php');

date_default_timezone_set('Africa/Lagos');
// if ($session->is_logged_in()) {
//     //redirect_to("dashboard.php");
// }


//If link is clicked from the mail, kindly activate the link and proceed with payment or scratch card page//


$error=array(
1=>'RRR could not be generated',
2=>'Admission type not selected !',
3=>'Your password confirmation do not match.',
4=>'Activation link could not be sent, check your internet connection.'

);

if (isset($_SESSION['paymentID'])){
    
   $paymentid=$_SESSION['paymentID'];
    
  // echo json_encode($paymentid);  
    $paydetails= Biodata::getpaymenttogenrrr($paymentid);
    
    $data='';
   //echo $paydetails->payerName;
    if (isset($paydetails->surname) and isset($paydetails->email) and isset($paydetails->phone))
    {
         $data=array(
        'name'=>ucwords($paydetails->surname.' '.$paydetails->othernames),
        'email'=>$paydetails->email,
        'phone'=>$paydetails->phone,
        'paymentid'=>$paydetails->id,
        'rrr'=>$paydetails->rrr
        );
    }
   
    if (sizeof($data)>0){
     
       echo json_encode($data);   
    }
  
    
    // $rawrrr=$paydetails->merchantId.$paydetails->serviceTypeId.$paydetails->amount.$paydetails->orderId.$paydetails->apiKey;
    //echo $rrr = hash('sha512',$rawrrr);
}else{
    echo 'Not set'; 
}
?>