<?
include("../connect.php"); 

if(isset($_POST['amount']) && isset($_POST['user_id'])){

	date_default_timezone_set('Asia/Calcutta');
	$user_id = $_POST['user_id'];
	$amount = $_POST['amount'];
	
	$time = time();

	$amount = (float)$amount;
	$receipt = 'rcptid_'.$time.'_'.$user_id;
	$postData = array(
		'amount' => (int)$amount, //in Paise
		'currency' => 'INR',  //Indian Rupees
		'receipt' => $receipt,  //unique everytime
		'payment_capture' => '1' //auto capture
	);
	
	$url="https://rzp_live_kA93dbQFCMNf0j:Fg0e61mR4TOSiYiW8KE9Gezm@api.razorpay.com/v1/orders"; //bth
	
	$ch = curl_init();
    		
    curl_setopt_array($ch, array(
    	CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => $postData
        //,CURLOPT_FOLLOWLOCATION => true
    ));
     
    //Ignore SSL certificate verification
    	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    
    //get response
    echo	$output = curl_exec($ch);
    //echo $output;   	
}
?>