Skip to content

feat(billing): add polar.sh payment integration and webhook verification - #18

Closed
Bloders-hub wants to merge 1 commit into
Ouzx:mainfrom
Bloders-hub:feat/polar-billing-module
Closed

Bloders-hub wants to merge 1 commit into
Ouzx:mainfrom
Bloders-hub:feat/polar-billing-module

Conversation

@Bloders-hub

Copy link
Copy Markdown

Description

Implements Polar.sh payments and billing integration as outlined in the roadmap (#5).

Key Changes:

  • packages/billing:
    • Added @orkide/billing package wrapping @polar-sh/sdk.
    • Implemented PolarBillingService for custom checkout sessions, customer portal sessions, and subscription listing.
    • Implemented Standard Webhooks (Svix/Polar HMAC-SHA256) signature verification using Web Crypto API (crypto.subtle), 100% compatible with Cloudflare Workers without Node dependencies.
    • Added replay attack protection with timestamp tolerance check.
  • apps/api:
    • Added billing.routes.ts providing endpoints: POST /checkout, GET /portal, and verified POST /webhook.
    • Mounted billingRoutes into the core API application router.
    • Added domain service billing.service.ts for handling subscription active/revocation events.

Testing:

  • Vitest tests included in packages/billing/src/webhook.test.ts.

Closes #5

@gitguardian

gitguardian Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@Bloders-hub
Bloders-hub force-pushed the feat/polar-billing-module branch from e40aa18 to 16e7de8 Compare October 14, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Payments with Polar.sh

1 participant