Viewing file: entrol_tpl_procc.php (25.62 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
$course_id=$_GET['id'];
$user_id=$_GET['uid'];
ob_start();
error_reporting(E_ALL);
$strNo = rand(1,10000000000);
$strNo1 = rand(1,1000000);
date_default_timezone_set('Asia/Calcutta');
$strCurDate = date('d-m-Y');
if( isset($_SERVER['HTTPS'] ) ) {
$host ='https';
}else{
$host = 'http';
}
$admin_data = file_get_contents("./worldline_AdminData.json");
$mer_array = json_decode($admin_data, true);
if($_POST)
{
$msg = $_POST['msg'];
$response_msg = explode("|", $msg);
// echo '<div class="alert alert-info">
// <strong>'.$msg.'</strong>
// </div>';
// echo "<br><br>";
$res_msg = explode("|",$_POST['msg']);
$arr_req = array(
"merchant" => [
"identifier" => $mer_array['merchantCode']
],
"transaction" => [ "deviceIdentifier" => "S","currency" => $mer_array['currency'],"dateTime" => $strCurDate,"token" => $res_msg[5],"requestType" => "S"]
);
$finalJsonReq = json_encode($arr_req);
function callAPI($method, $url, $finalJsonReq){
$curl = curl_init();
switch ($method){
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
if ($finalJsonReq)
curl_setopt($curl, CURLOPT_POSTFIELDS, $finalJsonReq);
break;
case "PUT":
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
if ($finalJsonReq)
curl_setopt($curl, CURLOPT_POSTFIELDS, $finalJsonReq);
break;
default:
if ($finalJsonReq)
$url = sprintf("%s?%s", $url, http_build_query($finalJsonReq));
}
// OPTIONS:
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
// EXECUTE:
$result = curl_exec($curl);
if(!$result){die("Connection Failure !! Try after some time.");}
curl_close($curl);
return $result;
}
$method = 'POST';
$url = "https://www.paynimo.com/api/paynimoV2.req";
$res_result = callAPI($method, $url, $finalJsonReq);
$dualVerifyData = json_decode($res_result, true);
?>
<?php if(isset($res_msg)) { ?>
<div class="container">
<div class="row">
<div class="col-md-12">
<?php
require 'connection.php';
if($response_msg[0]=='0300')
{
$course_id = $course_id;
$result = $con->query("SELECT * FROM course_details WHERE id='" . $course_id . "'");
$row = $result->fetch_assoc();
$course = $row['name'];
$pay = 'Online';
$message='test';
$item_code='test';
$user_id;
$result_user = $con->query("SELECT * FROM user_details WHERE user_id='" . $user_id . "'");
$row_user = $result_user->fetch_assoc();
$fname = $row_user['name'];
$phone = $row_user['phone'];
$email_new=$row_user['email'];
$txn_reference_no=$response_msg[3];
$amount=$response_msg[6];
$bank_reference_no=$response_msg[12];
$txn_date = $response_msg[8];
$sql = "insert into enrolldetails(user_id,course_id,course,amount,paymethod,message,paymentstatus,package) values('$user_id','$course_id','$course','$amount','$pay','$message','Completed','$course')";
$result = $con->query($sql);
$lastid = $con->insert_id;
$count = $con->affected_rows;
if ($count > 0)
{
$sql123="insert into tb_paymet(user_id,course_id,course,email,phone,txn_reference_no,bank_reference_no,txn_amount,item_code,txn_date) values('$user_id','$course_id','$course','$email_new','$phone','$txn_reference_no','$bank_reference_no','$amount','$item_code','$txn_date')";
// echo "insert into tb_paymet(user_id,course_id,course,email,phone,txn_reference_no,bank_reference_no,txn_amount,item_code,txn_date) values('$user_id','$course_id','$course','$email','$phone','$txn_reference_no','$bank_reference_no','$amount','$item_code','$txn_date')";
$result123 = $con->query($sql123);
$lastid123 = $con->insert_id;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Srishti Innovative Education Services Pvt Ltd</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"
integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
</head>
<body style="margin:0;padding:0;font-family: system-ui;">
<?php
//include 'header.php';
require 'connection.php';
session_start();
$uname = $_SESSION['user_name']=$fname;
$u_id = $_SESSION['user_id']=$user_id;
$user_id;
$result = $con->query("SELECT * FROM course_details WHERE id='" . $course_id . "'");
$row = $result->fetch_assoc();
$course = $row['name'];
?>
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
<tr>
<td align="center" style="padding:20px;">
<table role="presentation" style="width:950px;border-collapse:collapse;border:1px solid #cccccc;border-spacing:0;text-align:left; margin: : 20px">
<tr>
<td align="center" style="padding:20px;background:#fff; border-bottom: 31px solid #ccc;">
<div>
<div style="display: flex; justify-content: space-between; align-items: center;" >
<img style=" width: 220px;height: 100%;" src="images/sicsfullogo.png">
<div class="">
<!-- <h1 style=" margin: 0; padding:0; text-align:right; color: #ccc; margin-right: 17px;" >INVOICE</h1>-->
<!-- <span style=" color: #104eb1; font-weight: 500;margin-right: 0px 17px !important; padding:0; text-align:right;" ><i style="color: #104eb1; margin: 5px; font-size: 19px;" class="fas fa-mobile-alt"></i>9846011044</span>-->
<!-- <p style=" margin: 0; padding:0; text-align:right;" >1C 1st floor Carnival building Technopark Trivandrum</p>-->
</div>
</div>
</div>
</td>
</tr>
<tr>
<td style=" padding: 20px; display: flex;">
<table style="width: 100%;padding-right: 30px;" >
<tr style=" height: 40px;" >
<td style="font-weight:bold; color: #424242;" >Recepit.No</td>
<td style="text-align: right; padding-right:20px;" >#<?php echo $bank_reference_no;?></td>
</tr>
<tr style=" height: 40px;" >
<td style="font-weight:bold; color: #424242;" >Date</td>
<td style="text-align: right; padding-right:20px;" ><?php echo $txn_date;?></td>
</tr>
<tr style=" height: 40px;" >
<td style="font-weight:bold; color: #424242;" >Name of Student</td>
<td style="text-align: right; padding-right:20px;" ><?php echo $fname;?></td>
</tr>
<tr style=" height: 40px;" >
<td style="font-weight:bold; color: #424242;" >Phone</td>
<td style="text-align: right; padding-right:20px;" ><?php echo $phone;?></td>
</tr>
<tr style=" height: 40px;" >
<td style="font-weight:bold; color: #424242;" >Payment Mode</td>
<td style="text-align: right; padding-right:20px;" >Online</td>
</tr>
</table>
<table style="width: 100%;" >
<tr style=" height: 40px;" >
<td style="font-weight:bold; color: #424242;" >Payment Gate Way Transaction Reference no</td>
<td style="text-align: right; padding-right:20px;" ><?php echo $txn_reference_no;?></td>
</tr>
<tr style=" height: 40px;" >
<!-- <td style="font-weight:bold; color: #424242;" >Transaction Amount</td><?php $amount1=$amount/100;?>
<td style="text-align: right; padding-right:20px;" ><?php echo $amount1;?>.00</td> -->
<td style="font-weight:bold; color: #424242;" >Transaction Amount</td><?php $amount;?>
<td style="text-align: right; padding-right:20px;" ><?php echo $amount;?>.00</td>
</tr>
<tr style=" height: 40px;" >
<td style="font-weight:bold; color: #424242;" >Status of Transaction</td>
<td style="text-align: right; padding-right:20px;" ><?php echo $status;?></td>
</tr>
<tr style=" height: 40px;" >
<td style="font-weight:bold; color: #424242;" >Purpose of Payment</td>
<td style="text-align: right; padding-right:20px;" >Payment for <?php echo $course;?></td>
</tr>
<tr style=" height: 40px;" >
<td style="font-weight:bold;color: #424242; " >Status description</td>
<td style="text-align: right; padding-right:20px;" ></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding:10px 30px;">
<hr>
</td>
</tr>
<tr>
<td style="padding:10px 30px;">
<table style="width: 100%;">
<thead>
<tr style="background: #464343;color: #fff;border-bottom: 0px !important; height: 40px;">
<th style="padding-left: 10px;" scope="col">Item No</th>
<th style="padding-left: 10px;" scope="col">Descriptiont</th>
<th style="padding-left: 10px;" scope="col">Amount</th>
</tr>
</thead>
<tbody>
<tr style="height: 50px;" >
<!-- <th scope="row">1</th>-->
<td style="padding-left: 10px;" >1</td>
<td style="padding-left: 10px;" >Payment for <?php echo $course;?> </td>
<?php $amount;?>
<td style="padding-left: 10px; text-align: center;" ><?php echo $amount;?>.00</td>
</tr>
<tr style="height: 50px;">
<!-- <th scope="row">2</th>-->
<td></td>
<td style="padding-left: 10px;" ><b>TOTAL</b></td><?php $amount;?>
<td style="padding-left: 10px; background: #ccc; text-align: center; color: #104eb1;" ><b><?php echo $amount;?>.00</b></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="height: 200px;">
<div style="display: flex; justify-content: flex-end;padding: 30px; align-items: center;margin-top: 55px;" >
<div style="display: flex;flex-direction: column; align-items: center;" >
<img src="images/seal.png" style=" width: 160px; margin-right: 20px;" >
<h5 style="font-size: 22px;font-weight: 500;margin: 3px 8px;" >Authorized Signatory</h5>
</div>
</div>
</td>
</tr>
<tr>
<td style="padding:15px;background:#104eb1; color: #fff; justify-content: space-between;display: flex;">
<span>Srishti Innovative Education Services Pvt Ltd</span>
<!-- <span>1C 1st floor Carnival building Technopark Trivandrum </span>-->
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="col-12">
<button onClick="window.print();return false;" style="float: right;margin-right: 104px;margin-top: 25px;margin-bottom: 20px;">Print</button>
<a href="https://www.srishticampus.com/dashboard.php"> <button style="float: right;margin-right: 104px;margin-top: 25px;margin-bottom: 20px;">Go to Dashboard</button></a>
</div>
</body>
</html>
<?php
}
else
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Srishti Innovative Education Services Pvt Ltd</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"
integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
</head>
<body style="margin:0;padding:0;font-family: system-ui;">
<?php
//include 'header.php';
require 'connection.php';
session_start();
$uname = $_SESSION['user_name']=$fname;
$u_id = $_SESSION['user_id']=$user_id;
$user_id;
$result = $con->query("SELECT * FROM course_details WHERE id='" . $course_id . "'");
$row = $result->fetch_assoc();
$course = $row['name'];
?>
<!-- <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;margin-top: 12%;">
<tr>
<td align="center" style="padding:20px;font-size: 20px;font-weight: 700;">
Transaction Failed!!... Please Try again Later....
</td>
</tr>
</table> -->
<div class="col-12" style="text-align: center;">
<img src="images/Transaction-Failed.png">
</div>
<div class="col-12" style="text-align: center;">
<a href="https://www.srishticampus.com/enroll.php?id=<?php echo $course_id;?>" style="border: 1px solid #105ea3;
padding: 6px 15px;
min-width: 110px;
text-align: center;
color: #ffff;
font-size: 13px;
border-radius: 60px;
display: inline-block;
margin: 6px 10px 0px 0;
background: #105ea3;
text-decoration: none;"> Go to Enroll Page </a>
<!-- <button style="float: right;margin-right: 46%;margin-top: 25px;margin-bottom: 20px; background-color: #2d48cd;
width: 10%;
height: 30px;
color: white;">Go to Enroll Page</button> -->
</div>
</body>
</html>
<?php
}
?>
<?php } ?>
<?php
exit;
}
?>
<link rel="stylesheet" href="<?php echo $host."://".$_SERVER["HTTP_HOST"].'/php-checkoutjs/assets/css/bootstrap.min.css';?>">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" type="text/javascript"></script>
<script src="<?php echo $host."://".$_SERVER["HTTP_HOST"].'/php-checkoutjs/assets/js/bootstrap.min.js';?>"></script>
<?php if($mer_array['enableEmandate'] == 1 && $mer_array['enableSIDetailsAtMerchantEnd'] == 1){}elseif($mer_array['enableEmandate'] == 1 && $mer_array['enableSIDetailsAtMerchantEnd'] != 1){ ?>
<style type="text/css">
.hid{
display: none;
}
</style>
<?php }else{ ?>
<style type="text/css">
.hid{
display: none;
}
</style>
<?php } ?>
<script type="text/javascript" src="https://www.paynimo.com/Paynimocheckout/server/lib/checkout.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#btnSubmit").click(function(e){
e.preventDefault();
var str = $("#form").serialize();
//alert(str);
$.ajax({
type: 'POST',
cache: false,
data: str,
url: "payment_request.php",
success: function (response)
{
var obj = JSON.parse(response);
function handleResponse(res)
{
if (typeof res != 'undefined' && typeof res.paymentMethod != 'undefined' && typeof res.paymentMethod.paymentTransaction != 'undefined' && typeof res.paymentMethod.paymentTransaction.statusCode != 'undefined' && res.paymentMethod.paymentTransaction.statusCode == '0300') {
// success block
} else if (typeof res != 'undefined' && typeof res.paymentMethod != 'undefined' && typeof res.paymentMethod.paymentTransaction != 'undefined' && typeof res.paymentMethod.paymentTransaction.statusCode != 'undefined' && res.paymentMethod.paymentTransaction.statusCode == '0398') {
// initiated block
} else {
// error block
}
};
var configJson =
{
'tarCall': false,
'features': {
'showPGResponseMsg': true,
'enableNewWindowFlow': <?php if($mer_array['enableNewWindowFlow'] == 1){ echo 'true'; }else{ echo 'false'; } ?>, //for hybrid applications please disable this by passing false
'enableAbortResponse': true,
'enableExpressPay': <?php if($mer_array['enableExpressPay'] == 1){ echo 'true'; }else{ echo 'false'; } ?>, //if unique customer identifier is passed then save card functionality for end end customer
'enableInstrumentDeRegistration': <?php if($mer_array['enableInstrumentDeRegistration'] == 1){ echo 'true'; }else{ echo 'false'; } ?>, //if unique customer identifier is passed then option to delete saved card by end customer
'enableMerTxnDetails': true,
'siDetailsAtMerchantEnd': <?php if($mer_array['enableSIDetailsAtMerchantEnd'] == 1){ echo 'true'; }else{ echo 'false'; } ?>,
'enableSI': <?php if($mer_array['enableEmandate'] == 1){ echo 'true'; }else{ echo 'false'; } ?>,
'hideSIDetails': <?php if($mer_array['hideSIConfirmation'] == 1){ echo 'true'; }else{ echo 'false'; } ?>,
'enableDebitDay': <?php if($mer_array['enableDebitDay'] == 1){ echo 'true'; }else{ echo 'false'; } ?>,
'expandSIDetails': <?php if($mer_array['expandSIDetails'] == 1){ echo 'true'; }else{ echo 'false'; } ?>,
'enableTxnForNonSICards': <?php if($mer_array['enableTxnForNonSICards'] == 1){ echo 'true'; }else{ echo 'false'; } ?>,
'showSIConfirmation': <?php if($mer_array['showSIConfirmation'] == 1){ echo 'true'; }else{ echo 'false'; } ?>,
'showSIResponseMsg': <?php if($mer_array['showSIResponseMsg'] == 1){ echo 'true'; }else{ echo 'false'; } ?>,
},
'consumerData': {
'deviceId': 'WEBSH2',
//possible values 'WEBSH1', 'WEBSH2' and 'WEBMD5'
//'debitDay':'10',
'token': obj['hash'],
'returnUrl': obj['data'][12],
/*'redirectOnClose': 'https://www.tekprocess.co.in/MerchantIntegrationClient/MerchantResponsePage.jsp',*/
'responseHandler': handleResponse,
'paymentMode': '<?php if(isset($mer_array['paymentMode'])){ echo $mer_array['paymentMode']; } ?>',
'checkoutElement': '<?php if($mer_array['embedPaymentGatewayOnPage'] == "1"){ echo "#worldline_embeded_popup"; } else { echo ""; } ?>',
'merchantLogoUrl': '<?php if(isset($mer_array['logoURL'])){ echo $mer_array['logoURL']; } ?>', //provided merchant logo will be displayed
'merchantId': obj['data'][0],
'currency': obj['data'][15],
'consumerId': obj['data'][8], //Your unique consumer identifier to register a eMandate/eNACH
'consumerMobileNo': obj['data'][9],
'consumerEmailId': obj['data'][10],
'txnId': obj['data'][1], //Unique merchant transaction ID
'items': [{
'itemId': obj['data'][14],
'amount': obj['data'][2],
'comAmt': '0'
}],
'cartDescription': '}{custname:'+obj['data'][13],
'merRefDetails': [
{"name": "Txn. Ref. ID", "value": obj['data'][1]}
],
'customStyle': {
'PRIMARY_COLOR_CODE': '<?php if(isset($mer_array['primaryColor'])){ echo $mer_array['primaryColor']; } ?>', //merchant primary color code
'SECONDARY_COLOR_CODE': '<?php if(isset($mer_array['secondaryColor'])){ echo $mer_array['secondaryColor']; } ?>', //provide merchant's suitable color code
'BUTTON_COLOR_CODE_1': '<?php if(isset($mer_array['buttonColor1'])){ echo $mer_array['buttonColor1']; } ?>', //merchant's button background color code
'BUTTON_COLOR_CODE_2': '<?php if(isset($mer_array['buttonColor2'])){ echo $mer_array['buttonColor2']; } ?>' //provide merchant's suitable color code for button text
},
'accountNo': obj['data'][11], //Pass this if accountNo is captured at merchant side for eMandate/eNACH
'accountHolderName': obj['data'][16], //Pass this if accountHolderName is captured at merchant side for ICICI eMandate & eNACH registration this is mandatory field, if not passed from merchant Customer need to enter in Checkout UI.
'ifscCode': obj['data'][17], //Pass this if ifscCode is captured at merchant side.
'accountType': obj['data'][18], //Required for eNACH registration this is mandatory field
'debitStartDate': obj['data'][3],
'debitEndDate': obj['data'][4],
'maxAmount': obj['data'][5],
'amountType': obj['data'][6],
'frequency': obj['data'][7] // Available options DAIL, WEEK, MNTH, QURT, MIAN, YEAR, BIMN and ADHO
}
};
//console.log(configJson);
$.pnCheckout(configJson);
if(configJson.features.enableNewWindowFlow)
{
pnCheckoutShared.openNewWindow();
}
}
});
});
});
</script>
|