MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0750) :  /home2/imyrqtmy/public_html/agriba/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/agriba/payment.php
<?php require 'includes/db-conn.inc.php';?>
<!DOCTYPE html>
<html lang="en">
   <meta http-equiv="content-type" content="text/html;charset=utf-8" />
   <head>
        <link rel="stylesheet" href="css/index.css">
        <link rel="stylesheet" href="css/checkout.css">
     <?php  include 'includes/head.php';
      ?>

      <style>
         .stripe-button-el{
            width: 100%;
                background-image: linear-gradient(#dc3545,#dc3545) !important;
         }
         .stripe-button-el span{
            background: #ed4b62 !important;
            height: 41px !important;
    padding-top: 5px !important;
    font-size: 17px !important;

         }
      </style>
      <script src="https://checkout.razorpay.com/v1/checkout.js"></script>
   </head>
   <body>
      <div class="backdrop"></div>
      <a class="backtop fas fa-arrow-up" href="#"></a>
      <?php include 'includes/top-header.php';
            include 'includes/header.php';
            include 'includes/website-menu.php'; 
          include 'includes/side-category.php';
         // include 'includes/cart-sidebar.php';
            // include 'includes/side-menu.php';
            include 'includes/mobile-footer.php';
         ?>
      <section class="inner-section checkout-part">
         <div class="container">
            <div class="row">
               <div class="col-lg-12">
                  <div class="alert-info">
                     <h3>Pay Now</h3>
                  </div>
               </div>

               <div class="col-lg-12">
                  <div class="account-card mb-0">
                     <div class="account-title">
                        <!-- <h4>Pay Now</h4> -->
                        <img src="images/razorpay.png" style="width:125px;">
                     </div>
<?php 
$orderID =$_GET['orderid'];
$sql2 = mysqli_query($conn,"select * from order_master where detailsorder_id='$orderID' order by id desc")or die(mysqli_error($conn));
$row2 = mysqli_fetch_assoc($sql2);
?>                  
                  
                         <input class="form-control" type="hidden" name="billing_email" id="billing_email" required value="<?php echo $row2['email']?>" readonly>
                         <input class="form-control" type="hidden" name="billing_mobile" id="billing_mobile" required value="<?php echo $row2['phone']?>" readonly>
                          <input class="form-control" type="hidden" name="billing_name" id="billing_name" required value="<?php echo $row2['fName']?>" readonly>


                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                              <label class="form-label">Order ID<span class="text-danger">*</span></label><input class="form-control" name="orderID" id="orderID" type="text" required value="<?php echo $row2['detailsorder_id']?>" readonly>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                              <label class="form-label">Amount<span class="text-danger">*</span></label><input class="form-control" name="payAmount" id="payAmount" type="text" required value="<?php echo $row2['grandTotal']?>" readonly>
                              </div>
                           </div> 

                             <div class="checkout-proced"><button id="PayNow" type="submit" class="btn btn-inline">Proceed To pay</button></div> 
                        </div> 
                   
                  </div>
               </div>
            </div>
         </div>
      </section>
      <?php include 'includes/footer.php'; ?>
      <script src="vendor/bootstrap/jquery-1.12.4.min.js"></script><script src="vendor/bootstrap/popper.min.js"></script><script src="vendor/bootstrap/bootstrap.min.js"></script><script src="vendor/countdown/countdown.min.js"></script><script src="vendor/niceselect/nice-select.min.js"></script><script src="vendor/slickslider/slick.min.js"></script><script src="vendor/venobox/venobox.min.js"></script><script src="js/nice-select.js"></script><script src="js/countdown.js"></script><script src="js/accordion.js"></script><script src="js/venobox.js"></script><script src="js/slick.js"></script><script src="js/main.js"></script>

      <script>
    //Pay Amount
    jQuery(document).ready(function($){

jQuery('#PayNow').click(function(e){

    var paymentOption='';
let billing_name = $('#billing_name').val();
    let billing_mobile = $('#billing_mobile').val();
    let billing_email = $('#billing_email').val();
    var shipping_name = $('#billing_name').val();
    var shipping_mobile = $('#billing_mobile').val();
    var shipping_email = $('#billing_email').val();
    var order_ID = $('#orderID').val();
    var paymentOption= "netbanking";
    var payAmount = $('#payAmount').val();
            
var request_url="submitpayment.php";
        var formData = {
            billing_name:billing_name,
            billing_mobile:billing_mobile,
            billing_email:billing_email,
            shipping_name:shipping_name,
            shipping_mobile:shipping_mobile,
            shipping_email:shipping_email,
            paymentOption:paymentOption,
            payAmount:payAmount,
            order_ID:order_ID,
            action:'payOrder'
        }
        
        $.ajax({
            type: 'POST',
            url:request_url,
            data:formData,
            dataType: 'json',
            encode:true,
        }).done(function(data){
        
        if(data.res=='success'){
                var orderID=data.order_number;
                var orderNumber=data.order_number;
                var options = {
    "key": data.razorpay_key, // Enter the Key ID generated from the Dashboard
    "amount": data.userData.amount, // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise
    "currency": "INR",
    "name": "Lakshya Resin Art Hub", //your business name
    "description": data.userData.description,
    "image": "https://lakshyaresinarthub.in/images/logo.png",
    "order_id": data.userData.rpay_order_id, //This is a sample Order ID. Pass 
    "handler": function (response){

    window.location.replace("payment-success.php?oid="+orderID+"&rp_payment_id="+response.razorpay_payment_id+"&rp_signature="+response.razorpay_signature);

    },
    "modal": {
    "ondismiss": function(){
         window.location.replace("payment.php?&orderid="+orderID);
     }
},
    "prefill": { //We recommend using the prefill parameter to auto-fill customer's contact information especially their phone number
        "name": data.userData.name, //your customer's name
        "email": data.userData.email,
        "contact": data.userData.mobile //Provide the customer's phone number for better conversion rates 
    },
    "notes": {
        "address": "Lakshya Resin Art Hub"
    },
    "config": {
    "display": {
      "blocks": {
        "banks": {
          "name": 'Pay using '+paymentOption,
          "instruments": [
           
            {
                "method": paymentOption
            },
            ],
        },
      },
      "sequence": ['block.banks'],
      "preferences": {
        "show_default_blocks": true,
      },
    },
  },
    "theme": {
        "color": "#EB3C4F"
    }
};
var rzp1 = new Razorpay(options);
rzp1.on('payment.failed', function (response){

    window.location.replace("payment-failed.php?oid="+orderID+"&reason="+response.error.description+"&paymentid="+response.error.metadata.payment_id);

         });
      rzp1.open();
     e.preventDefault(); 
}
 
});
 });
    });
</script>
   </body>
 
</html>

MMCT - 2023