返回 Skill 列表
extension
分类: 开发与工程无需 API Key

stripe-checkout-subscriptions

在Flutter/Supabase后端创建Stripe Checkout Sessions以实现订阅的指南。涵盖流程、API偏好设置和不可协商的规则。

person作者: jakexiaohubgithub

Stripe Checkout Subscriptions

Source of Truth: All subscription states derive from Stripe Webhooks.

Backend Flow

Client → Create Checkout Session → Stripe → Webhook → Supabase.

Flutter Client

  • Listen to profiles table in Supabase for status updates post-payment.
  • Flutter app NEVER updates its own is_premium flag; it only reads backend-provided state.

Implementation Rules (Non-Negotiable)

  • Use Stripe Checkout Sessions API for one-time payments and subscriptions.
  • Model taxes/discounts via Stripe.
  • For recurring revenue (SaaS-like): Prefer Billing APIs + Stripe Checkout.
  • Never use Charges API. Migrate to Checkout Sessions or Payment Intents if needed.
  • For web: Prioritize Stripe-hosted Checkout or embedded Checkout. Payment Element OK for advanced customization (pair with Checkout Sessions).
  • Never recommend legacy Card Element or Payment Element in card mode.
  • Avoid deprecated Sources API or outdated Tokens/Charges. Use Setup Intent API for saving payment methods.
  • For pre‑PaymentIntent rendering: Use Stripe Confirmation Tokens, not createPaymentMethod/createToken.
  • Turn on dynamic payment methods in dashboard (don't hardcode payment_method_types).
  • Default to latest API version: 2026-01-28.clover (unless user specifies otherwise).
  • Use env vars: STRIPE_SECRET_KEY.

Integration Resources

  • Stripe Integration Options / API Tour docs.
  • Go Live Checklist before production.