Files
Momento/memento-note/lib/stripe.ts
Antigravity aa12d2226f
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 4s
feat(story-3.6): complete Stripe subscription tiers — enterprise card, build fix, i18n
Story 3.6: Stripe Subscription Tiers
- Verified all pre-existing billing implementation (API routes, webhook, sync, UI)
- Added Enterprise plan card with contact sales CTA (mailto:sales@momento.app)
- Fixed lib/stripe.ts build error (lazy getStripe() + placeholder default)
- Added enterpriseFeature1-5 i18n keys to all 15 locales
- 22/22 unit tests pass, build succeeds
- Story status: ready-for-dev → review
2026-05-16 20:50:29 +00:00

23 lines
557 B
TypeScript

import Stripe from 'stripe';
let _stripe: Stripe | null = null;
export function getStripe(): Stripe {
if (!_stripe) {
const key = process.env.STRIPE_SECRET_KEY;
if (!key) {
throw new Error('STRIPE_SECRET_KEY is required. Set it in .env or environment.');
}
_stripe = new Stripe(key, {
apiVersion: '2026-04-22.dahlia',
typescript: true,
});
}
return _stripe;
}
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY ?? 'sk_test_placeholder', {
apiVersion: '2026-04-22.dahlia',
typescript: true,
});