Skip to content

Build the Checkout return pages and claim the Pro license after purchase #21

Description

@PAMulligan

Description

When a user completes Stripe Checkout, Stripe redirects to https://optia.pmdevsolutions.com/billing/success?session_id={CHECKOUT_SESSION_ID} (and /billing/cancel if they abort). Today the success URL 404s. Build the Checkout return pages and wire the extension to claim the minted license key and auto-activate Pro, so a buyer goes from payment to unlocked without typing a key by hand.

The backend mints the key server-side from the webhook and stashes the raw key for one-time pickup at GET /billing/session/:id (bound to installId, single-use); POST /billing/checkout already returns { url, sessionId } so the extension knows which session to claim.

Why

Webhooks are the source of truth and the key never ships in the extension bundle, so the buyer still needs a way to receive it on their install. Without the return page + claim wiring a successful payment dead-ends on a 404 and the user has no path to Pro — a guaranteed support ticket right after they pay. Completing this closes the purchase → unlock loop.

Acceptance Criteria

  • …/billing/success exists (no 404): reads session_id and shows a clear "Payment complete — return to Optia" confirmation
  • …/billing/cancel exists with a friendly "checkout canceled" message and a way back to upgrade
  • After checkout the extension claims the key via GET /billing/session/:id?installId=… using the sessionId from /billing/checkout (polls pendingready; single-use)
  • On ready, the extension activates Pro via /license/activate and refreshes the entitlement — no manual key entry
  • gone / forbidden / expired-claim states handled with friendly messaging and a fallback to manual key entry (account UI, Add license and account UI in options (activate, manage, restore) #11)
  • No raw card or financial data handled in the extension
  • Tests for the claim/activate flow (pending, ready, gone, error)
  • CI passes

Resources

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions