feat(integrations): push Polar order, subscription, and refund events by webhook
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nextjs, playwright, react, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 1
- Merge trung bình
- 6 giờ 56 phút
- Pull request đã merge (30 ngày)
- 136
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eddiejaoude/StackDash
-
area: docs documentation priority: P3 size: S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eddiejaoude/StackDash#462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: web bug priority: P3 size: XS
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
eddiejaoude/StackDash#432 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: database bug priority: P3 size: S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eddiejaoude/StackDash#419 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs bug priority: P2 size: XS
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
eddiejaoude/StackDash#418 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility area: timeline bug priority: P3 size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
eddiejaoude/StackDash#389 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của eddiejaoude/StackDash
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
open-webui/tether#52 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`void platform install --app-access public` fails when Cloudflare reports Access is disabledĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
voidzero-dev/void#835 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AykutSarac/jsoncrack.com#616 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
melgarafael/DeskcommCRM#4679 ·
Maintainer thường phản hồi trong vòng 1 ngày