ok

Mini Shell

Direktori : /home2/selectio/www/wedding-info-new/api/
Upload File :
Current File : /home2/selectio/www/wedding-info-new/api/process_payment.php

<?php   
error_log('Razorpay payment process started...');


include_once ('config/config.php');
session_start();

// Decode the JSON data received from the form
$payment_details = json_decode($_POST['payment_details'], true);

// Extract data from the JSON object
$name = $payment_details['name'];
$amount = $payment_details['amount'] * 100; // Convert amount to paise if using INR
$description = $payment_details['description'];
$plan = $payment_details['plan'];
$razorpay_payment_id = $payment_details['razorpay_payment_id'];

try {
    // Prepare SQL statement
    $stmt = $pdo->prepare("INSERT INTO razorpay_payment (plan,name, amount, payment_status, payment_id) VALUES (?,?, ?, ?, ?)");
    $stmt->execute([$plan,$name, $amount, $description, $razorpay_payment_id]);

    header("Location: ../index.php");
    exit();
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage();
}
?>

Zerion Mini Shell 1.0