ZH
测试版翻译

@core / billing

1.0.0 ▾
已验证MIT
GitHub

Stripe 订阅:结账、客户门户和幂等 Webhook(Drizzle)

代码9 个文件上下文约 633 个 tokenMCP stripe扫描通过

应用 .genpmignore 后将被注入的确切目录树。固定于

src/lib/billing/stripe.ts只读 · 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;
}

举报 @core/billing

使用 GitHub 登录后才能举报包。