import Stripe from "stripe"; import config from "./config"; const apiKey = config.stripe.secretKey && config.stripe.secretKey.trim() !== "" ? config.stripe.secretKey : "sk_test_placeholder_key_for_build_purposes"; let _stripe = null; export function getStripe() { if (!_stripe) { _stripe = new Stripe(apiKey, { apiVersion: "2024-04-10" }); } return _stripe; } export const stripe = new Proxy({}, { get(_target, prop) { return getStripe()[prop]; }, });