require_once '../../admin/includes/config.php'; $settings = $con->query("SELECT * FROM payment_system where id = 1")->fetch_assoc(); $ammountTotal = $settings['set_amount2']?$settings['set_amount2']:100; $chk = $con->query("SELECT * FROM students where mobile = '".$_POST['mobile']."' AND email = '".$_POST['email']."'"); if(!($chk->num_rows)) { if(!isset($_POST['payment_provider'])){ $img = photo_upload('image','students'); if($img['status']) { $con->query("INSERT INTO `students` (`id`, `timestamp`, `enrollment_no`, `name`, `gender`, `father`, `mother`, `dob`, `mobile`, `email`, `state`, `distric`, `exam_pass`, `marks`, `board`, `year`, `username`, `password`, `course_id`, `center_id`, `photo`, `transection_id`, `status`) VALUES (NULL, CURRENT_TIMESTAMP, 'NYCLM00001".time()."', '".$_POST['name']."', '".$_POST['gender']."', '".$_POST['father']."', '".$_POST['mother']."', '".$_POST['dob']."', '".$_POST['mobile']."', '".$_POST['email']."', '".$_POST['state']."', '".$_POST['distric']."', '".$_POST['exam_pass']."', '".$_POST['marks']."', '".$_POST['board']."', '".$_POST['year']."', '".$_POST['username']."', '".$_POST['password']."', '".$_POST['course_id']."', '".$_SESSION['center']['id']."', '".$img['file_name']."', '', '')"); // echo ''; $id = $con->insert_id; } else { echo ''; } } } $payment_id = rand(0000,100000); $__call_back = 'http://nyclmindia.in'; $MERCHANT_KEY = $settings['secret_key']; // merchant key $SALT = $settings['salt_key']; $__manageData = array(); $__manageData['key'] = $MERCHANT_KEY; $__manageData['amount'] = $ammountTotal; $__manageData['firstname'] = $_POST['name']; $__manageData['email'] = $_POST['email']; $__manageData['phone'] = $_POST['mobile']; $__manageData['productinfo']= "reseller"; $__manageData['surl'] = $_call_back."http://nyclmindia.in/center/pay/payment_status.php"; $__manageData['furl'] = $_call_back."http://nyclmindia.in/center/pay/payment_status.php"; $__manageData['udf1'] = $payment_id; $__manageData['udf2'] = $id; $__manageData['service_provider'] = "payu_paisa"; $PAYU_BASE_URL = "https://secure.payu.in"; $action = ''; $posted = array(); $posted = $__manageData; $_POST['amount'] = $ammountTotal; //array_merge($__manageData,$posted); if(!empty($_POST)){ foreach($_POST as $key => $value) { $posted[$key] = $value; } } $formError = 0; if(empty($posted['txnid'])) { $txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20); } else { $txnid = $posted['txnid']; } $hash = ''; $hashSequence = "key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10"; if(empty($posted['hash']) && sizeof($posted) > 0) { if( empty($posted['key']) || empty($posted['txnid']) || empty($posted['amount']) || empty($posted['firstname']) || empty($posted['email']) || empty($posted['phone']) || empty($posted['productinfo']) || empty($posted['surl']) || empty($posted['furl']) || empty($posted['service_provider']) ) { $formError = 1; } else { $hashVarsSeq = explode('|', $hashSequence); $hash_string = ''; foreach($hashVarsSeq as $hash_var) { $hash_string .= isset($posted[$hash_var]) ? $posted[$hash_var] : ''; $hash_string .= '|'; } $hash_string .= $SALT; $hash = strtolower(hash('sha512', $hash_string)); $action = $PAYU_BASE_URL . '/_payment'; } } elseif(!empty($posted['hash'])) { $hash = $posted['hash']; $action = $PAYU_BASE_URL . '/_payment'; } ?>