feat(integrations): push Polar order, subscription, and refund events by webhook
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nextjs, playwright, react, typescript
Direzione di ricerca
Start with step 1: read docs/providers/polar.md ("Permissions") and Polar's webhook API docs to pin down the create endpoint, signature scheme and headers, and the delivery id to deduplicate on, then record findings on the issue. Code lives in src/lib/adapters/polar/; the mapping of order.paid and friends onto existing event types is what the timeline consumes, so read that event pipeline before writing handlers. It is blocked on #28 (ingest contract) and #426 (setup panel), so confirm those have landed first. Done means both setup paths work against the simulated Polar provider, deliveries are verified, deduplicated, and logged without bodies, and unit plus Playwright tests pass under npm test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
Decision on #424 (2026-11-14): Polar offers automatic setup as an opt-in and setup by hand. Polar has no read-only scope that can create a webhook: automatic setup needs webhooks:write, while the adapter holds read scopes only (docs/providers/polar.md, "Permissions"). The panel in #426 warns about this before asking, and points users who want DevMacro to stay read-only to setup by hand.
| Item | Value |
|---|---|
| Create | Webhook endpoints through the API with webhooks:write, or by hand in Polar's webhook settings |
| Events for the timeline | order.paid, order.refunded, subscription.created, subscription.canceled, subscription.revoked, refund.created, mapped to the adapter's polar.order.paid, polar.subscription.started, polar.subscription.canceled, polar.refund.succeeded |
| Not pushed | Revenue, fees, and recurring revenue from Polar's analytics. Polling stays |
Plan
- Confirm from Polar's docs, before any code: the create endpoint, its request and response (whether it returns the signing secret), the signature scheme and headers, and the delivery id to deduplicate on. Record them on this issue and in the provider page.
- Declare Polar's webhook in the #28 contract: automatic setup needs
webhooks:write, steps for setup by hand. - Automatic: after the opt-in consent for
webhooks:write, create the endpoint with DevMacro's URL and the events above, store its secret encrypted, delete it on disconnect. - By hand: show the URL and the steps, and a field for Polar's signing secret if Polar generates it.
- Verify signatures, deduplicate, map deliveries to the connection by the per-connection URL. Deliveries become the existing event types, so polling and webhooks show one entry.
- Docs:
docs/providers/polar.md("Permissions", "Permission risks" forwebhooks:write, "Webhooks").
Acceptance criteria
- Step 1 findings recorded with links to Polar's docs.
- The opt-in write access warning from #426 shows before Polar's consent screen.
- Automatic setup creates the endpoint, and a paid order reaches the timeline within a minute.
- Setup by hand works without requesting
webhooks:write. - Disconnect deletes an automatic endpoint.
- Unsigned, wrongly signed, stale, or repeated deliveries are rejected or ignored, and logged without their body.
- Unit tests on recorded, sanitized payloads from Polar's documented samples. No live calls in CI.
- Playwright e2e: both setup paths for the simulated Polar provider.
Files and areas
src/lib/adapters/polar/,docs/providers/polar.md,docs/operations/oauth-apps.md.- Non-goals: other write scopes, pushing analytics figures.
Verification
npm run lint,npm run typecheck,npm test- Playwright spec for both setup paths.
Depends on
- #28 Ingest provider webhooks
- #426 Webhook setup panel
Branch: <issue-number>-polar-webhooks
Closes with a Closes #<issue-number> footer on the commit or pull request.
Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 1
- Merge medio
- 6h 56m
- PR unite (30g)
- 136
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di eddiejaoude/StackDash
-
area: docs documentation priority: P3 size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
eddiejaoude/StackDash#462 ·
I maintainer di solito rispondono entro 1 giorno
-
area: web bug priority: P3 size: XS
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
eddiejaoude/StackDash#432 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: database bug priority: P3 size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eddiejaoude/StackDash#419 ·
I maintainer di solito rispondono entro 1 giorno
-
area: docs bug priority: P2 size: XS
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
eddiejaoude/StackDash#418 ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility area: timeline bug priority: P3 size: XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
eddiejaoude/StackDash#389 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di eddiejaoude/StackDash
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
open-webui/tether#52 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
voidzero-dev/void#835 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AykutSarac/jsoncrack.com#616 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
melgarafael/DeskcommCRM#4679 ·
I maintainer di solito rispondono entro 1 giorno