Skip to content

feat(billing): Stripe Managed Payments licensing with Polar fallback - #25

Merged
0xNyk merged 1 commit into
mainfrom
feat/stripe-managed-payments
Sep 14, 2026
Merged

0xNyk merged 1 commit into
mainfrom
feat/stripe-managed-payments

Conversation

@0xNyk

@0xNyk 0xNyk commented Sep 14, 2026

Copy link
Copy Markdown
Member

What

Moves Dictx Pro checkout and licensing from Polar to Stripe Managed Payments (Link is the seller of record), without breaking installed apps or existing customers.

  • /buy → api/buy.js: the Stripe Payment Link once STRIPE_SECRET_KEY, DICTX_STRIPE_PRICE_ID, DICTX_LICENSE_SECRET and a canonical live DICTX_STRIPE_PAYMENT_LINK are all valid; Polar until then.
  • /api/pro/license issues dxp-<session>-<hmac> keys for verified purchases (live mode forced in production, complete and paid, exactly one Dictx Pro price at quantity 1, not refunded or disputed).
  • /api/pro/verify checks dxp- keys against Stripe without Polar config; lk_ / polar_cl_ keys keep the Polar path. Refunds and disputes deactivate on the next app check; Stripe outages return 502 (app keeps current state).
  • Keys use only [A-Za-z0-9_-], which installed app versions already send to /api/pro/verify, so no app release is needed.
  • /buy/success fetches the key for Stripe sessions and keeps Polar behaviour otherwise. FAQ copy, all 17 locale placeholders, README setup and env docs.

Stripe objects (live, created with the Stripe CLI)

  • Product prod_VGAwMgXh0UgB0w, tax code txcd_10202000 (Downloadable Software)
  • Price price_1UFeb2IOmsupAvc3VoCin47h, $29 USD
  • Payment Link plink_1UFebaIOmsupAvc3m6DV45ul, Managed Payments on, redirect to /buy/success?session_id={CHECKOUT_SESSION_ID}

DICTX_STRIPE_PRICE_ID, DICTX_STRIPE_PAYMENT_LINK, DICTX_LICENSE_SECRET are set in Vercel production. STRIPE_SECRET_KEY is not yet; /buy stays on Polar until it is.

Verification

  • landing/tests/billing.test.js: 7/7 (key integrity, exact classification, production live mode, /buy fail-closed, license endpoint, verify routing, refund deactivation)
  • Live checkout renders "Sold through Link"

https://claude.ai/code/session_01CvRJfFeFvF96jhBFujxvHN

Moves Dictx Pro checkout and licensing from Polar to Stripe Managed
Payments (Link is the seller of record, as for the other SplitLabs products
on the same Stripe account), without breaking installed apps or existing
customers.

- /buy is now api/buy.js: the Stripe Payment Link once STRIPE_SECRET_KEY,
  DICTX_STRIPE_PRICE_ID, DICTX_LICENSE_SECRET and a canonical live
  DICTX_STRIPE_PAYMENT_LINK are all valid; the Polar checkout until then.
  Deploying this changes nothing for buyers until Stripe is configured.
- /api/pro/license issues dxp-<session>-<hmac> keys for verified purchases:
  live mode (forced in production), complete and paid, exactly one Dictx
  Pro price at quantity 1, charge neither refunded nor disputed.
- /api/pro/verify checks dxp- keys against Stripe with no Polar config
  needed; lk_/polar_cl_ keys keep the Polar path. Refunds and disputes
  deactivate on the next app check; Stripe outages return 502, which the
  app treats as keep-current-state. Positive results cache for 10 minutes.
- Keys use only [A-Za-z0-9_-], the charset installed app versions already
  send to /api/pro/verify, so no app release is needed to activate them.
- /buy/success fetches and shows the key for Stripe sessions, keeps the
  Polar URL behaviour otherwise, and points failures to the published
  SplitLabs contact. Reopening the page reissues the same key.
- Copy: landing FAQ and the licenseKeyPlaceholder in all 17 locales.
- README: Stripe setup steps, env vars, lost-key recovery.
- landing/tests/billing.test.js (7 tests) covers key integrity, exact
  classification, production live-mode, /buy fail-closed, the license
  endpoint, verify routing, and refund deactivation.

Not included: email delivery of keys (no mail provider on this project)
and a Stripe webhook; entitlement correctness comes from re-verifying the
live session instead.

Claude-Session: https://claude.ai/code/session_01CvRJfFeFvF96jhBFujxvHN
@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dictx Ready Ready Preview Sep 14, 2026 6:31pm UTC

Request Review

@0xNyk
0xNyk merged commit 308b5fd into main Sep 14, 2026
3 of 6 checks passed
@0xNyk
0xNyk deleted the feat/stripe-managed-payments branch September 14, 2026 18:31

This branch was successfully deployed

1 active deployment
Preview — cca05fee Deployed Sep 14, 2026 by vercel[bot]
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.

1 participant