import Razorpay from "razorpay"; const razorpay = new Razorpay({ key_id: "rzp_live_REdeGZclfm8KFo", key_secret: "BXgwGPsYhxgUYsozCr2uoEZC", }); export async function POST(req) { try { const body = await req.json(); // Parse the request body const { amount, currency } = body; const order = await razorpay.orders.create({ amount, currency, }); return new Response(JSON.stringify(order), { status: 200 }); } catch (error) { console.error("Error creating Razorpay order:", error); return new Response(JSON.stringify({ error: "Failed to create Razorpay order" }), { status: 500 }); } }