Commit Graph
3 Commits
Author SHA1 Message Date
dhkatz a6337f09b6 docs(payments): PayPal beside Patreon, our own checkout later (#28)
Release / release (push) Successful in 4s
CI / test (push) Successful in 1m36s
CI / image (apps/api/Dockerfile, t5de-hub-api) (push) Successful in 4s
CI / image (apps/web/Dockerfile, t5de-hub-web) (push) Successful in 4s
Updates the payments plan with PayPal and the decisions since #26.

**docs/payments.md**
- **PayPal (new section):** sold exactly as priced, $1.99 a month or $19.99 a year per room, as one subscription with a room count.
  - **Setup:** the product, plans and webhook are made through PayPal's API, and their IDs go in the config. The sandbox ones exist already.
  - **Checkout:** a redirect. The subscription carries the account (`custom_id` = the person's `sub`) and the VAT override.
  - **Webhook:** verified by PayPal's own `verify-webhook-signature`; the subscription is then fetched again from PayPal, plus a nightly sync. A status table says what each PayPal state grants.
- **Tax:**
  - **EU VAT:** non-Union OSS, with VAT included in the price. Each sale records two pieces of country evidence (the buyer's choice and their IP's country); if they disagree, no sale. The service makes the quarterly report itself.
  - **UK:** handled once registered with HMRC.
  - **US:** state thresholds, with sales reported per state.
  - **Where it sells first:** outside the EU and the UK until those registrations take effect.
- **No website of its own:** the app's pages use the API. The browser only passes through `/link/patreon`, `/checkout/paypal` and `/manage/<source>`, which return only to listed addresses.
- **Checkout elements (later):** our own checkout as iframes from `payments.t5de.dev`, so the processor doesn't show and Patreon can go.
- **Environments:** staging uses PayPal's sandbox and the locked staging hub. Patreon has no test mode, so both of its redirect URIs are listed.
- Goals, the processors table, lapses, phases (Patreon, then PayPal, then elements) and "before taking money" updated to match.

**docs/music.md:** the paid tier lists both ways to pay, plus the later checkout.

Updates the payments plan with PayPal and the decisions since #26.

**docs/payments.md**
- **PayPal (new section):** sold exactly as priced, $1.99 a month or $19.99 a year per room, as one subscription with a room count.
  - **Setup:** the product, plans and webhook are made through PayPal's API, and their IDs go in the config. The sandbox ones exist already.
  - **Checkout:** a redirect. The subscription carries the account (`custom_id` = the person's `sub`) and the VAT override.
  - **Webhook:** verified by PayPal's own `verify-webhook-signature`; the subscription is then fetched again from PayPal, plus a nightly sync. A status table says what each PayPal state grants.
- **Tax:**
  - **EU VAT:** non-Union OSS, with VAT included in the price. Each sale records two pieces of country evidence (the buyer's choice and their IP's country); if they disagree, no sale. The service makes the quarterly report itself.
  - **UK:** handled once registered with HMRC.
  - **US:** state thresholds, with sales reported per state.
  - **Where it sells first:** outside the EU and the UK until those registrations take effect.
- **No website of its own:** the app's pages use the API. The browser only passes through `/link/patreon`, `/checkout/paypal` and `/manage/<source>`, which return only to listed addresses.
- **Checkout elements (later):** our own checkout as iframes from `payments.t5de.dev`, so the processor doesn't show and Patreon can go.
- **Environments:** staging uses PayPal's sandbox and the locked staging hub. Patreon has no test mode, so both of its redirect URIs are listed.
- Goals, the processors table, lapses, phases (Patreon, then PayPal, then elements) and "before taking money" updated to match.

**docs/music.md:** the paid tier lists both ways to pay, plus the later checkout.

Co-authored-by: dhkatz <[email protected]>
2026-11-20 23:38:00 +00:00
dhkatz 02e8269d4d docs(payments): a payments service of its own, Patreon first (#26)
Release / release (push) Successful in 4s
CI / test (push) Successful in 1m36s
CI / image (apps/api/Dockerfile, t5de-hub-api) (push) Successful in 5s
CI / image (apps/web/Dockerfile, t5de-hub-web) (push) Successful in 4s
Rewrites the payments plan for a separate payments service, with Patreon as the first way to pay.

**docs/payments.md**
- **`t5de-payments` is its own service:** its own repo, Postgres database and secrets, at `payments.t5de.dev`, to contain the compliance risk. The hub and Music never hold a payment provider's key. Music reads entitlements (`GET /v1/entitlements/{sub}`), is told about changes over a signed back-channel call, and keeps the last answer it got.
- **Patreon first:** Patreon is the seller, so it handles sales tax and VAT.
  - **Linking:** members link Patreon with OAuth (`identity`).
  - **Tiers:** which tier gives how much is set in config in git.
  - **Webhook:** the service checks its webhook exists and is set up right on every start, and fixes it if not. Requests are verified with `X-Patreon-Signature` (HMAC-MD5).
  - **State:** after a webhook it re-fetches the member from Patreon, and a nightly sync of every member catches anything missed.
  - **Grace:** access runs until `next_charge_date` plus 7 days.
  - **Tokens:** Patreon rotates the creator token's refresh token, so the current pair is kept in the database.
- **Entitlements are counts** (`music.rooms` × N), because a Patreon member has only one tier. Moderators' grants (no money) come first, in phase 1.
- **Processors:**
  - **Polar:** used only if their support says yes in writing. Its acceptable use policy names YouTube downloaders (#30) and circumventing other services' terms (#18).
  - **Not used:** Stripe or PayPal directly (we'd be the seller), and IMVU credits.

**docs/music.md**
- **The paid tier sells hosting only.** YouTube limits are now the same in both tiers.
- **Tiers:** Room ($1.99, 1 room) and Rooms ($4.99, 3 rooms). The owner picks which rooms are paid. When the count drops, the most recently picked rooms go back to free first.
- The risks section and phase 3b point to t5de-payments.

Rewrites the payments plan for a separate payments service, with Patreon as the first way to pay.

**docs/payments.md**
- **`t5de-payments` is its own service:** its own repo, Postgres database and secrets, at `payments.t5de.dev`, to contain the compliance risk. The hub and Music never hold a payment provider's key. Music reads entitlements (`GET /v1/entitlements/{sub}`), is told about changes over a signed back-channel call, and keeps the last answer it got.
- **Patreon first:** Patreon is the seller, so it handles sales tax and VAT.
  - **Linking:** members link Patreon with OAuth (`identity`).
  - **Tiers:** which tier gives how much is set in config in git.
  - **Webhook:** the service checks its webhook exists and is set up right on every start, and fixes it if not. Requests are verified with `X-Patreon-Signature` (HMAC-MD5).
  - **State:** after a webhook it re-fetches the member from Patreon, and a nightly sync of every member catches anything missed.
  - **Grace:** access runs until `next_charge_date` plus 7 days.
  - **Tokens:** Patreon rotates the creator token's refresh token, so the current pair is kept in the database.
- **Entitlements are counts** (`music.rooms` × N), because a Patreon member has only one tier. Moderators' grants (no money) come first, in phase 1.
- **Processors:**
  - **Polar:** used only if their support says yes in writing. Its acceptable use policy names YouTube downloaders (#30) and circumventing other services' terms (#18).
  - **Not used:** Stripe or PayPal directly (we'd be the seller), and IMVU credits.

**docs/music.md**
- **The paid tier sells hosting only.** YouTube limits are now the same in both tiers.
- **Tiers:** Room ($1.99, 1 room) and Rooms ($4.99, 3 rooms). The owner picks which rooms are paid. When the count drops, the most recently picked rooms go back to free first.
- The risks section and phase 3b point to t5de-payments.

Co-authored-by: dhkatz <[email protected]>
2026-11-20 19:38:01 +00:00
dhkatz a66a3a4b6a docs: Music and shared accounts plan (#21)
Release / release (push) Successful in 3s
CI / test (push) Successful in 1m30s
CI / image (apps/api/Dockerfile, t5de-hub-api) (push) Successful in 8s
CI / image (apps/web/Dockerfile, t5de-hub-web) (push) Successful in 20s
Plan for T5DE Music and the account and payment changes it needs. Docs only; no code changes.

- `docs/music.md`: an IMVU room music bot. The website is music.t5de.dev (at home); streams are radio.t5de.dev (Oracle Cloud's free tier, dhkatz/infra `music-oracle`). Covers one account system with Discord sign-in and basic accounts, the hub as an OIDC provider with Music as its first client, room ownership from linked IMVU accounts, chat commands and permissions, pluggable sources modelled on HorizonRadio's (stations, own streams, YouTube), relayed vs direct streams, and the paid tier (sell the hosting; $1.99 a month per room).
- `docs/payments.md`: billing in the hub's API, shared by Music and the hub. Separate merchants per product (adult content needs different processors), processor adapters, entitlements, credits, and selling as an individual.
- `README.md`: links to both.

Decisions are marked **Decided**; the rest are proposals, with the open ones at the end of each doc.

Plan for T5DE Music and the account and payment changes it needs. Docs only; no code changes.

- `docs/music.md`: an IMVU room music bot. The website is music.t5de.dev (at home); streams are radio.t5de.dev (Oracle Cloud's free tier, dhkatz/infra `music-oracle`). Covers one account system with Discord sign-in and basic accounts, the hub as an OIDC provider with Music as its first client, room ownership from linked IMVU accounts, chat commands and permissions, pluggable sources modelled on HorizonRadio's (stations, own streams, YouTube), relayed vs direct streams, and the paid tier (sell the hosting; $1.99 a month per room).
- `docs/payments.md`: billing in the hub's API, shared by Music and the hub. Separate merchants per product (adult content needs different processors), processor adapters, entitlements, credits, and selling as an individual.
- `README.md`: links to both.

Decisions are marked **Decided**; the rest are proposals, with the open ones at the end of each doc.

Co-authored-by: dhkatz <[email protected]>
2026-11-18 22:29:48 +00:00