# Billing pipeline host preflight — aieditorrsp

Status: HOST_PREFLIGHT_ONLY_NOT_DEPLOYED

User asked to open login/payment, then clarified this must be routed through the site Kanban pipeline rather than implemented directly by host.

Host-side preflight already performed before clarification:

- D1 database created: `aieditorrsp-db`
- D1 database id: `a9d3f65c-15e6-406f-8147-e20e3f526fb6`
- Initial billing/auth schema was applied locally and remotely once.
- Stripe live product created: `prod_UbbP8eNBYFoBOv`
- Stripe live prices created:
  - monthly Pro $12/mo: `price_1TcOD5BKSbQI2GbGoh3Xi5K4`
  - yearly Pro $96/yr: `price_1TcOD6BKSbQI2GbGcEGXliis`
  - credit pack $6/100 credits: `price_1TcOD6BKSbQI2GbGkcjrhFDM`
- Stripe webhook endpoint created: `we_1TcOD6BKSbQI2GbGy9zFEqbx`
- Worker secrets set:
  - `GOOGLE_CLIENT_ID`
  - `GOOGLE_CLIENT_SECRET`
  - `JWT_SECRET`
  - `STRIPE_SECRET_KEY`
  - `STRIPE_WEBHOOK_SECRET`
  - `STRIPE_PRICE_ID_MONTHLY`
  - `STRIPE_PRICE_ID_YEARLY`
  - `STRIPE_PRICE_ID_CREDIT_PACK`

Important:
- Do not print or expose secrets.
- Host did not deploy billing/auth code after the clarification.
- There is a local WIP stash named `host-preflight-billing-auth-before-kanban-routing` that workers may inspect with `git stash show -p stash^{/host-preflight-billing-auth-before-kanban-routing}` if useful, but they should own the final implementation and review it normally.

Required pipeline:
1. 墨账: verify pricing/tax plan and Stripe Tax readiness.
2. 墨枢: implement auth + Stripe Checkout + webhook + D1 credit ledger; use Stripe Tax hard requirements.
3. 墨界: wire frontend buttons/status to real auth/checkout/credits.
4. 墨盾: compliance/legal recheck after paid live copy.
5. 墨测: final E2E QA, including auth redirects, Checkout redirect creation, webhook handling if testable, credit accounting, and SEO regression.
