Initial working state: CL3.5 complete (Plesk sync + suspend/unsuspend)
This commit is contained in:
19
lib/stripe.ts
Normal file
19
lib/stripe.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import Stripe from "stripe";
|
||||
|
||||
import { env } from "@/lib/env";
|
||||
|
||||
let stripeClient: Stripe | null = null;
|
||||
|
||||
export function getStripeClient() {
|
||||
if (!env.stripeSecretKey) {
|
||||
throw new Error("STRIPE_SECRET_KEY is not configured");
|
||||
}
|
||||
|
||||
if (!stripeClient) {
|
||||
stripeClient = new Stripe(env.stripeSecretKey, {
|
||||
apiVersion: "2025-02-24.acacia",
|
||||
});
|
||||
}
|
||||
|
||||
return stripeClient;
|
||||
}
|
||||
Reference in New Issue
Block a user