fix(recovery): restore source removed by production documentation merge
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import Stripe from "stripe";
|
||||
|
||||
// Lazy, env-guarded Stripe client. Returns null when STRIPE_SECRET_KEY is unset
|
||||
// so the app builds/runs without keys; payment routes 501 until configured.
|
||||
let _stripe: Stripe | null = null;
|
||||
|
||||
export function getStripe(): Stripe | null {
|
||||
const key = process.env.STRIPE_SECRET_KEY;
|
||||
if (!key) return null;
|
||||
if (!_stripe) _stripe = new Stripe(key);
|
||||
return _stripe;
|
||||
}
|
||||
Reference in New Issue
Block a user