[POC][DO_NOT_MERGE] feat: customer billing portal POC #58
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.
This pull request adds functionality to allow users to view their purchase receipt by introducing a "View Receipt" button in the purchase summary. The implementation includes a new hook to create a billing portal session, supporting backend integration and query management. The most important changes are summarized below:
Screen.Recording.2025-10-01.at.1.09.55.AM.mov
UI Enhancements:
ReceiptButtoncomponent to thePurchaseSummarycard, providing users with a "View Receipt" button that links to their billing portal session if available. (src/components/PurchaseSummary/PurchaseSummary.tsx,src/components/PurchaseSummary/ReceiptButton.tsx) [1] [2] [3]Data Layer & API Integration:
useCreateBillingPortalSessionhook to handle fetching the billing portal session URL, integrating user context and backend query logic. (src/components/app/data/hooks/useCreateBillingPortalSession.tsx,src/components/app/data/hooks/index.ts) [1] [2]queryCreateBillingPortalSessionto the data queries, enabling requests to the backend for creating billing portal sessions. (src/components/app/data/queries/queries.ts)createBillingPortalSessionquery key and function in the query key factory for consistent query management. (src/components/app/data/queries/queryKeyFactory.ts) [1] [2]create-billing-portal.tsservice to handle authenticated API requests for creating billing portal sessions. (src/components/app/data/services/create-billing-portal.ts)Type Improvements:
determineExistingCheckoutIntentStateto ensure correct intent typing. (src/components/app/routes/loaders/utils.ts)This PR requires the create portal session endpoint to be updated.
openedx/enterprise-access#860