3456,
'amount' => $price * 100, // 2000 rupees in paise
'currency' => 'INR',
'payment_capture' => 1, // auto capture
];
$razorpayOrder = $api->order->create($orderData);
$razorpayOrderId = $razorpayOrder['id'];
$_SESSION['razorpay_order_id'] = $razorpayOrderId;
$browsessionid=session_id();
$member_id = $_SESSION['member_id'];
$Updatecart = mysql_query("UPDATE tbl_appointment SET `razid`='$razorpayOrderId' WHERE `session_id`='$browsessionid' and status='0'");
$displayAmount = $amount = $orderData['amount'];
// $Updatecart = mysql_query("UPDATE shop_cart SET `trans`='$razorpayOrderId' WHERE `session_id`='$browsessionid' ");
$displayAmount = $amount = $orderData['amount'];
//send email for online consultation
$get_con = mysqli_query($conn, "select tm.name, ta.mem_id, ta.consulting_for, tm.phone, tm.dob, tm.location_city, ta.appointment_date, ta.amount, ta.vehicle, ta.hour_date, ta.min_date, ta.am_date from tbl_appointment ta inner join tbl_member tm on ta.mem_id = tm.id where tm.id = '$member_id'");
$get_consult = mysqli_fetch_array($get_con, MYSQLI_ASSOC);
$hour_date = $get_consult['hour_date'];
if($get_consult['min_date'] == 0){
$min_date = '00 '.$get_consult['am_date'];
}else{
$min_date = $get_consult['min_date'].' '.$get_consult['am_date'];
}
$msg_to_verify = '
Name |
'.$get_consult['name'].' |
Age |
'.$get_consult['dob'].' |
Phone |
'.$get_consult['phone'].' |
Location |
'.$get_consult['location_city'].' |
Consulting For |
'.$get_consult['consulting_for'].' |
How do you know Doctor |
'.$get_consult['vehicle'].' |
Appointment Date & Time |
'.date('d-m-Y', strtotime($get_consult['appointment_date'])).' '.$hour_date.' '.$min_date.' |
Booked Date & Time |
'.date('d-m-Y H:i:s').' |
Amount |
'.$price.' |
Razorpay Order Id |
'.$razorpayOrderId.' |
Session ID |
'.$browsessionid.' |
';
$insert = "INSERT INTO tbl_missed_oc_log
(cust_name, mem_id, amount, app_date, hour_date, min_date, am_date, dob, phone, location_city, consulting_for, reference, email, country, razid, session_id, created_at, payment_status)
VALUES('".$get_consult['name']."', '$mymemid', '$price', '".$get_consult['appointment_date']."', '$hour_date', '".$get_consult['min_date']."', '".$get_consult['am_date']."', '".$get_consult['dob']."', '".$get_consult['phone']."', '".$get_consult['location_city']."', '".$get_consult['consulting_for']."', '".$get_consult['vehicle']."', '$email', '$mycountry', '$razorpayOrderId', '$browsessionid', CURRENT_TIMESTAMP, 'pre-order');";
mysqli_query($conn, $insert);
$subject_to_verify = 'Online Consultation Form Submitted by '.$get_consult['name'].' / '.$get_consult['phone'].' / '.$razorpayOrderId;
$_SESSION['msg_to_verify'] = $msg_to_verify;
$_SESSION['subject_to_verify'] = $subject_to_verify;
send_mail($subject_to_verify, $msg_to_verify);
// unset($_SESSION['member_id']);
sleep(2);
if ($displayCurrency !== 'INR') {
$url = "https://api.fixer.io/latest?symbols=$displayCurrency&base=INR";
$exchange = json_decode(file_get_contents($url), true);
$displayAmount = $exchange['rates'][$displayCurrency] * $amount / 100;
}
$data = [
"key" => $keyId,
"amount" => $amount,
"name" => "ENERGY FOODS",
"description" => "Dr. G.ANBUGANAPATHI",
"image" => "http://drganbuganapathi.com/default/img/anbuganapathi.jpg",
"prefill" => [
"name" => $customer,
"email" => $email,
"contact" => $contact,
],
"notes" => [
"address" => "Hello World",
"merchant_order_id" => "12312321",
],
"theme" => [
"color" => "#F37254",
],
"order_id" => $razorpayOrderId,
];
if ($displayCurrency !== 'INR') {
$data['display_currency'] = $displayCurrency;
$data['display_amount'] = $displayAmount;
}
$json = json_encode($data);
?>
Your payment is being submitted. Please do not close this window or click the Back button on your browser.