stripe-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStripe Design
Stripe集成设计
Create a design document for Stripe integration.
创建一份Stripe集成的设计文档。
Objective
目标
Produce a clear, implementable design that follows our business model preferences and current Stripe best practices.
生成一份清晰、可落地的设计方案,既要符合我们的业务模式偏好,也要遵循当前Stripe的最佳实践。
Process
流程
1. Understand Requirements
What does this app need? Usually one of:
- Subscription billing (most common)
- One-time payments
- Both
Reference for constraints: single tier, trial with completion on upgrade, no freemium.
business-model-preferences2. Research Current Patterns
Stripe's API evolves. Before designing:
- Use Gemini to check current Stripe Checkout best practices
- Verify webhook event recommendations
- Check if there are new patterns for your use case
Don't assume last year's patterns are still optimal.
3. Design the Integration
Produce a design document covering:
Checkout Flow
- Embedded or redirect?
- What mode? (subscription, payment, setup)
- Customer creation strategy
- Success/cancel URLs
- Trial strategy: Credit card upfront (preferred) with
trial_period_days
Webhook Events
- Which events to handle?
- Idempotency strategy
- Error handling approach
Subscription State
- What fields to store locally?
- Access control logic
- Trial handling
Price Structure
- Monthly price (and annual if applicable)
- Trial duration
4. Get Validation
Run the design through Thinktank for multi-perspective review. Billing is critical — get expert opinions before implementation.
1. 理解需求
这款应用需要什么功能?通常是以下其中一种:
- 订阅计费(最常见)
- 一次性支付
- 两者兼具
参考中的约束条件:单一服务层级、升级时完成试用流程、不提供免费增值模式。
business-model-preferences2. 调研当前模式
Stripe的API在不断演进。开始设计前:
- 使用Gemini查询当前Stripe Checkout的最佳实践
- 验证Webhook事件的推荐配置
- 检查你的使用场景是否有新的实现模式
不要假设去年的模式仍然是最优解。
3. 设计集成方案
生成一份涵盖以下内容的设计文档:
结账流程
- 采用嵌入式还是跳转式?
- 使用什么模式?(订阅、支付、设置)
- 用户创建策略
- 成功/取消跳转URL
- 试用策略: 优先采用预收集信用卡信息的方式,搭配参数
trial_period_days
Webhook事件
- 需要处理哪些事件?
- 幂等性策略
- 错误处理方案
订阅状态
- 本地需要存储哪些字段?
- 访问控制逻辑
- 试用流程处理
价格结构
- 月度定价(若适用则包含年度定价)
- 试用时长
4. 验证确认
将设计方案提交给Thinktank进行多视角评审。计费系统至关重要——在实现前务必获取专家意见。
Output
输出
A design document that can implement. Include:
stripe-scaffold- Architecture decisions with rationale
- Specific Stripe API features to use
- Data model for subscription state
- Webhook events to subscribe to
- Access control logic
一份可供实现的设计文档,需包含:
stripe-scaffold- 架构决策及其依据
- 要使用的具体Stripe API功能
- 订阅状态的数据模型
- 需要订阅的Webhook事件
- 访问控制逻辑
Adaptation
适配性
Design for the detected stack (usually Next.js + Convex + Clerk). If stack differs, adapt the design to that stack's patterns while maintaining the same Stripe concepts.
针对检测到的技术栈(通常为Next.js + Convex + Clerk)进行设计。若技术栈不同,需在保留Stripe核心概念的前提下,调整设计以适配该技术栈的模式。