Name Last Update
..
tables Loading commit data...
README.md Loading commit data...
index.js Loading commit data...

README.md

@drama/billing Database Schema

这里是 @drama/billing 当前表结构的唯一阅读入口。

  • tables/:一个表一个文件,文件名等于表名。
  • tables/index.cjs:批量加载入口,只给显式初始化/测试/校验工具使用,不是人工阅读入口。

表

  • tables/billing_product.cjs
  • tables/billing_ledger.cjs
  • tables/billing_unlock.cjs
  • tables/billing_free_quota.cjs
  • tables/billing_paywall_rule.cjs
  • tables/points_balance_view.cjs

Stripe Price ID 约定

billing_product.stripe_price_id 是商品目录到 Stripe 的唯一绑定字段。它必须保存 Stripe 测试/生产环境真实存在的 price_...,不能保存本地占位值并期待 @drama/payment 自动转换。

@drama/payment 创建 Checkout Session 时只按 productId 读取 billing.products.get(productId),然后把 stripe_price_id 作为 Stripe line_items[].price 传给官方 SDK。

本地 Stripe 测试流程见 packages/payment/docs/stripe/README.md。