Skip to content

feat(billing): wire pymthouse getPlans + subscribe checkout - #455

Draft
eliteprox wants to merge 4 commits into
mainfrom
feat/pymthouse-getplans-subscribe
Draft

feat(billing): wire pymthouse getPlans + subscribe checkout#455
eliteprox wants to merge 4 commits into
mainfrom
feat/pymthouse-getplans-subscribe

Conversation

@eliteprox

@eliteprox eliteprox commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implements BPP ④ getPlans on PymthouseAdapter via listBillingProductsmapBillingProductsToPlans (active products only).
  • Adds optional SPI subscribe? via SDK createBillingCheckout (@pymthouse/builder-sdk@0.6.3).
  • Billing BFF (provider_adapters): GET /api/v1/billing/{provider}/plans, POST /api/v1/billing/{provider}/subscribe.
  • Team multi-sub create with providerPlanId starts provider checkout before persisting the local row (no orphan on checkout failure) and returns checkoutUrl / subscriptionRef.
  • Docs: marketplace section + SDK pin updated in docs/pymthouse-integration.md.

Test plan

  • Targeted vitests (plans mapper, adapter, catalog parse, billing BFF, team subscriptions)
  • Pinned to published @pymthouse/builder-sdk@0.6.3
  • Manual: with provider_adapters ON + pymthouse M2M env, GET /api/v1/billing/pymthouse/plans returns live products
  • Manual: POST …/subscribe with a real planId returns a Stripe Checkout URL

Expose BPP plan catalogue and optional M2M checkout through the
PymthouseAdapter so agent/BFF callers can list plans and start Stripe
Checkout without inventing marketplace UI or last-mile credit APIs.
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
naap-platform Ready Ready Preview Aug 6, 2026 3:15am

Request Review

@github-actions github-actions Bot added the size/XL Extra large PR (500+ lines) label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

⚠️ This PR is very large (674 lines changed). Please split it into smaller, focused PRs if possible.

@github-actions github-actions Bot added the scope/shell Shell app changes label Aug 6, 2026
@eliteprox
eliteprox marked this pull request as draft August 6, 2026 02:12
Drop the hand-rolled M2M checkout helper; adapter.subscribe and error
mapping now go through PmtHouseClient / PmtHouseError from builder-sdk.
@eliteprox

Copy link
Copy Markdown
Contributor Author

Follow-up pushed: subscribe now uses @pymthouse/builder-sdk createBillingCheckout (git pin to feat/create-billing-checkout until 0.6.2 publishes). Hand-rolled pymthouse-billing-checkout.ts removed; route errors map PmtHouseError.

Related:

builder-sdk#50 merged and published; replace the git branch pin so
createBillingCheckout comes from the npm release.
@eliteprox

Copy link
Copy Markdown
Contributor Author

Pinned to published @pymthouse/builder-sdk@0.6.2 now that pymthouse/builder-sdk#50 is merged.

Move off the interim 0.6.2 pin to the published Sonar/CI security patch.
@eliteprox

Copy link
Copy Markdown
Contributor Author

Bumped pin to published @pymthouse/builder-sdk@0.6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/shell Shell app changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant