GIF89a php
Current File : /home/hencockfreshchic/public_html/pay.php
<?php

$user=$_GET['userName'];
$value=$_GET['amount'];
$name='Admission Fees';
$phone=$_GET['mobile'];
$email=$_GET['email'];
$address='NA';
$city='NA';
$state='NA';
$Pincode='110088';
$uid=$_GET['orderid'];
// check date format to table saleProduct
$txnid1=$_GET['orderid'];


				setcookie("uid", $uid, time()+3600);
				setcookie("mobb", $phone, time()+3600);

  // Merchant key here as provided by Payu
  $MERCHANT_KEY = "oD1gsbGilll";
  // Merchant Salt as provided by Payu
  $SALT = "7c6ueFuEvddddd";
  // End point - change to https://secure.payu.in for LIVE mode
  $PAYU_BASE_URL = "https://secure.payu.in";
  $action = '';
  $posted = array();
  if(!empty($_POST)) {
      //print_r($_POST);
    foreach($_POST as $key => $value) { 
      $posted[$key] = $value; 
    }
  }

  $formError = 0;
  if(empty($posted['txnid'])) {
    // Generate random transaction id
    $txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);
  } else {
    $txnid = $posted['txnid'];
  }

  $hash = '';
  // Hash Sequence
  $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 {
      //$posted['productinfo'] = json_encode(json_decode('[{"name":"tutionfee","description":"","value":"500","isRequired":"false"},{"name":"developmentfee","description":"monthly tution fee","value":"1500","isRequired":"false"}]'));

    $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';
}

?>
<html>
<head>
  <script>
  var hash = '<?php echo $hash ?>';
  function submitPayuForm() {
    if(hash == '') {
      return;
    }

    var payuForm = document.forms.payuForm;
    payuForm.submit();

  }
  </script>
</head>

<body onload="submitPayuForm()">
<center><h2>NEPTUNE INSTITUTE OF MANAGEMENT & ENGINEERING PAYMENTS</h2><br>
	<img src="http://nimeedu.in/images/logo.png" style="width: 130px;height: 60px">
<h5>Powered by PayUMoney Payments co. systems </h5></center>
  <br/>

  <?php if($formError) { ?>
  <span style="color:red">Please fill all mandatory fields.</span>
  <br/>
  <br/>
  <?php } ?>

  <form action="<?php echo $action; ?>" method="post" name="payuForm">

    <input type="hidden" name="key" value="<?php echo $MERCHANT_KEY ?>" />
    <input type="hidden" name="hash" value="<?php echo $hash ?>"/>
    <input type="hidden" name="txnid" value="<?php echo $txnid ?>" />
    <center>
    <table>      
      <tr>
         <input type="hidden" name="amount" value="<?php echo $_GET['amount']; ?>" />  
        <input type="hidden" name="firstname" id="firstname" value="<?php echo $_GET['userName']; ?>" />
      	<input type="hidden" name="email" id="email" value="<?php echo $_GET['email']; ?>" />      
        <input type="hidden" name="phone" value="<?php echo $_GET['mobile']; ?>" />
          
        <?php
        $arr = json_encode(array('name'=>$_GET['userName'],'description'=>'OASIS SOLAR PRODUCTS','value'=>$_GET['amount'],'isRequired'=>'true','settlementEvent'=>'EmailConfirmation'));
        ?>
        <textarea style="display: none;" name="productinfo"><?php echo (empty($arr)) ? '' : $arr ?></textarea><input type="hidden" name="surl" value="https://oasissolar.in/success.php" size="64" />
        <input type="hidden" name="furl" value="https://oasissolar.in/failure.php" size="64" />
     	<input type="hidden" name="service_provider" value="payu_paisa" size="64" />
     	<input type="hidden" name="lastname" id="lastname" value="<?php echo $_GET['userName']; ?>" />
        <input type="hidden" name="curl" value="https://oasissolar.in/failure.php" />
      	<input type="hidden" name="address1" value="<?php echo $_GET['address']; ?>" />     
        <input type="hidden" name="address2" value="<?php echo $_GET['address']; ?>" />
     	 <input type="hidden" name="city" value="<?php echo $_GET['city']; ?>" />     
        <input type="hidden" name="state" value="<?php echo $_GET['state']; ?>" />
      	<input type="hidden" name="country" value="India" />  
        <input type="hidden" name="zipcode" value="<?php echo $_GET['pincode']; ?>" />
      	<input type="hidden" name="udf1" value="<?php echo (empty($posted['udf1'])) ? '' : $posted['udf1']; ?>" />
        <input type="hidden" name="udf2" value="<?php echo (empty($posted['udf2'])) ? '' : $posted['udf2']; ?>" />
      	<input type="hidden" name="udf3" value="<?php echo (empty($posted['udf3'])) ? '' : $posted['udf3']; ?>" /> 
        <input type="hidden" name="udf4" value="<?php echo (empty($posted['udf4'])) ? '' : $posted['udf4']; ?>" />
      	<input type="hidden" name="udf5" value="<?php echo (empty($posted['udf5'])) ? '' : $posted['udf5']; ?>" />
        <input type="hidden" name="pg" value="<?php echo (empty($posted['pg'])) ? '' : $posted['pg']; ?>" />
     
        <?php if(!$hash) { ?>
        	<center>
        <td colspan="4"><input type="submit" value="Proceed..." /></td>
        <?php } ?>
      </tr>
    </table>
    </center>
  </form>
</body>
</html>