ClauseGuard / web /lib /razorpay.ts
gaurv007's picture
Replace Stripe with Razorpay: subscriptions, webhooks, checkout modal, INR pricing
fbf3514 verified
import Razorpay from "razorpay";
let _razorpay: Razorpay | null = null;
export function getRazorpay(): Razorpay {
if (!_razorpay) {
_razorpay = new Razorpay({
key_id: process.env.RAZORPAY_KEY_ID!,
key_secret: process.env.RAZORPAY_KEY_SECRET!,
});
}
return _razorpay;
}
export const PLANS = {
free: {
name: "Free",
scans: 10,
razorpay_plan_id: null,
price_label: "₹0",
features: ["10 scans per month", "All 8 clause categories", "Risk score and grade"],
},
pro: {
name: "Pro",
scans: Infinity,
razorpay_plan_id: process.env.RAZORPAY_PRO_PLAN_ID!,
price_label: "₹999/mo",
features: ["Unlimited scans", "Contract uploads", "Clause explanations", "PDF exports"],
},
team: {
name: "Team",
scans: Infinity,
razorpay_plan_id: process.env.RAZORPAY_TEAM_PLAN_ID!,
price_label: "₹3,999/mo",
features: ["Everything in Pro", "5 team seats", "10K API calls", "Priority support"],
},
} as const;
export type PlanType = keyof typeof PLANS;