| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/vhost/gyaniguru.org/admin/ |
Upload File : |
<?php
require('vendor/autoload.php');
use Razorpay\Api\Api;
// Razorpay API Key and Secret
$api = new Api('rzp_test_idUUc7YfZtYbaZ', 'hkobqqyspaqbpJlgOuEkQg9O');
try {
// Generate a dynamic receipt ID
$receiptId = 'order_' . uniqid();
// Create an order
$orderData = [
'receipt' => $receiptId,
'amount' => 29900, // Amount in paise (e.g., Rs 299 = 29900 paise)
'currency' => 'INR',
'payment_capture' => 1 // Auto-capture
];
$order = $api->order->create($orderData);
// Return order details as JSON
echo json_encode([
'order_id' => $order['id'],
'amount' => $order['amount'],
'currency' => $order['currency']
]);
} catch (Exception $e) {
// Log the error message for debugging (optional)
file_put_contents('razorpay_log.txt', print_r($e->getMessage(), true), FILE_APPEND);
// Return error as JSON
echo json_encode(['error' => $e->getMessage()]);
}
?>