Billing Portal: Phase 2 License Issuance#174
Merged
Merged
Conversation
overheadhunter
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 wires the billing page to the API-owned session-to-license flow. Phase 1 got us a verified session; this exchanges that session for the actual Hub license and drops the old assumption that the store hands back the license token.
Two changes in
hubsubscription.js:sessionin the Paddle checkout passthrough (alongsidehub_id), so the payment webhook can tie the new subscription back to the session. Without it the API can't link the billing item and license issuance fails.GET /licenses/hub?session=...instead of refreshing it from a store-returned token. Themanage-subscriptionresponses no longer carrytoken/session, so that handling (and the?session=undefinedhistory rewrite) is removed.Pairs with the store changes (cryptomator/store#24) and the API session-aware endpoints. Stacked on Phase 1 (#170); base moves to develop once that merges.
Flow
sequenceDiagram participant Web as Billing Page participant Store participant Paddle participant API Web->>Store: generate-pay-link Web->>Paddle: Checkout.open (passthrough {hub_id, session}) Paddle--)API: webhook (passthrough {hub_id, session}) API->>API: link billing item to session Web->>API: GET /licenses/hub?session=... API-->>Web: Hub license