EN

@core / billing

1.0.0 ▾
verifiedMIT
GitHub

Stripe subscriptions: checkout, portal and idempotent webhooks with Drizzle

Code9 filesContext~633 tokensMCP stripescan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/lib/billing/stripe.tsread-only · a8a5ac1
// Cliente de Stripe perezoso desde STRIPE_SECRET_KEY. `setStripe` permite inyectar otro en tests.
import Stripe from 'stripe';

let current: Stripe | null = null;

export function getStripe(): Stripe {
  if (!current) {
    const key = process.env.STRIPE_SECRET_KEY;
    if (!key) throw new Error('STRIPE_SECRET_KEY is not set (see .env.example)');
    current = new Stripe(key);
  }
  return current;
}

export function setStripe(stripe: Stripe): void {
  current = stripe;
}

Report @core/billing

Sign in with GitHub to report a package.