-
Notifications
You must be signed in to change notification settings - Fork 576
Feat/unstract payments support related updates #1087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
…stack/unstract into feat/unstract-payment-integration-fe
…s-and-transform-llmwhisperer-v2-schema-for-cloud
…form-llmwhisperer-v2-schema-for-cloud' of github.com:Zipstack/unstract into feat/support-readonly-for-custom-rjsf-widgets-and-transform-llmwhisperer-v2-schema-for-cloud
…s-and-transform-llmwhisperer-v2-schema-for-cloud
…s-and-transform-llmwhisperer-v2-schema-for-cloud
…form-llmwhisperer-v2-schema-for-cloud' of github.com:Zipstack/unstract
for more information, see https://pre-commit.ci
johnyrahul
approved these changes
Jan 23, 2025
|
Contributor
|
muhammad-ali-e
approved these changes
Jan 24, 2025
Contributor
muhammad-ali-e
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
vishnuszipstack
approved these changes
Jan 24, 2025
pk-zipstack
pushed a commit
that referenced
this pull request
Aug 20, 2025
* Implemented changes related to unstract subscription * Have different home pages for OSS and Cloud * Renamed the unstract subscription pages and replaced '<></>' with '<Outlet />' * Updated import path of the TrialDaysInfo component * Support 'readonly' parameter for all custom RJSF widgets * Transform the JSON schema for the LLM Whisperer V2 adapter for cloud * Fixed Eslint issues * Code quality improvement * Allow JSON schema transform for LLMW V2 only for paid plan users * Allow JSON schema transform for LLMW V2 only for paid plan users * Fix sonar issue * Implemented the to structure the API path * Rearranged the onboard and subscription check APIs * Unstract payment supporting updates * X2text metadata updates * Adapter update for unstarct payments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Minor fix in the API path * Review comments updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Tahier Hussain <[email protected]> Co-authored-by: Tahier Hussain <[email protected]> Co-authored-by: vishnuszipstack <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
athul-rs
added a commit
that referenced
this pull request
Nov 10, 2025
This commit adds comprehensive support for admins to create custom Stripe subscription products for both Unstract and LLM Whisperer platforms. ## Frontend Changes ### Router Updates (Router.jsx) - Added dynamic import for LlmWhispererCustomCheckoutPage plugin component - Added public route `/llm-whisperer/custom-checkout` for LLM Whisperer custom plan checkout flow - Follows existing pattern with try/catch for Cloud-only features ### Main App Routes (useMainAppRoutes.js) - Added Unstract administration route at `/administration` - Protected with RequireAdmin wrapper (admin-only access) - Imported UnstractAdministrationPage component ### New Administration Page (UnstractAdministrationPage.jsx) - Plugin-loader pattern with try/catch for Cloud-only component - Falls back to "feature not available" message in OSS builds - Dynamically imports UnstractAdministration from Cloud plugins ## Backend Changes (Already Committed) The backend infrastructure was already added in previous commits: ### Subscription Routes (cloud_urls_v2.py) - Unstract admin endpoint: `/api/v1/unstract/admin/stripe/products/dynamic/` - LLM Whisperer admin endpoint: `/api/v1/llmwhisperer/admin/stripe/products/dynamic/portal/` ### Portal Proxy (subscription_v2/views.py) - `create_dynamic_stripe_product_portal_proxy()` method forwards LLM Whisperer admin requests to Portal service - Follows existing LLMWhispererService pattern for multi-backend architecture - Includes proper error handling and logging ### URL Patterns (subscription_v2/urls.py) - Added `admin_stripe_product_portal_proxy` view and URL pattern - Both endpoints protected with IsAuthenticated + IsAdmin permissions ## Architecture This implementation follows Unstract's plugin-based architecture: - OSS repo contains base routing and plugin-loader patterns - Cloud repo contains actual admin UI components (subscription-admin plugin) - Multi-backend support: Unstract uses local backend, LLM Whisperer proxies to Portal service - Graceful degradation for OSS builds (shows "Cloud-only feature" message) ## Related - Supersedes PR #1087 (monolithic admin UI) - Integrates checkout functionality from PR #1016 - Consolidates router changes from PR #1558 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
johnyrahul
added a commit
that referenced
this pull request
Nov 13, 2025
* feat: Add admin custom Stripe product creation support This commit adds comprehensive support for admins to create custom Stripe subscription products for both Unstract and LLM Whisperer platforms. ## Frontend Changes ### Router Updates (Router.jsx) - Added dynamic import for LlmWhispererCustomCheckoutPage plugin component - Added public route `/llm-whisperer/custom-checkout` for LLM Whisperer custom plan checkout flow - Follows existing pattern with try/catch for Cloud-only features ### Main App Routes (useMainAppRoutes.js) - Added Unstract administration route at `/administration` - Protected with RequireAdmin wrapper (admin-only access) - Imported UnstractAdministrationPage component ### New Administration Page (UnstractAdministrationPage.jsx) - Plugin-loader pattern with try/catch for Cloud-only component - Falls back to "feature not available" message in OSS builds - Dynamically imports UnstractAdministration from Cloud plugins ## Backend Changes (Already Committed) The backend infrastructure was already added in previous commits: ### Subscription Routes (cloud_urls_v2.py) - Unstract admin endpoint: `/api/v1/unstract/admin/stripe/products/dynamic/` - LLM Whisperer admin endpoint: `/api/v1/llmwhisperer/admin/stripe/products/dynamic/portal/` ### Portal Proxy (subscription_v2/views.py) - `create_dynamic_stripe_product_portal_proxy()` method forwards LLM Whisperer admin requests to Portal service - Follows existing LLMWhispererService pattern for multi-backend architecture - Includes proper error handling and logging ### URL Patterns (subscription_v2/urls.py) - Added `admin_stripe_product_portal_proxy` view and URL pattern - Both endpoints protected with IsAuthenticated + IsAdmin permissions ## Architecture This implementation follows Unstract's plugin-based architecture: - OSS repo contains base routing and plugin-loader patterns - Cloud repo contains actual admin UI components (subscription-admin plugin) - Multi-backend support: Unstract uses local backend, LLM Whisperer proxies to Portal service - Graceful degradation for OSS builds (shows "Cloud-only feature" message) ## Related - Supersedes PR #1087 (monolithic admin UI) - Integrates checkout functionality from PR #1016 - Consolidates router changes from PR #1558 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * chore: Add NOSONAR comments for plugin loading pattern Suppress SonarQube warnings for intentional empty catch blocks used in plugin loading architecture. These catch blocks are part of the graceful degradation pattern for Cloud-only features - when plugins are not available, the component remains undefined and React Router triggers NotFound page. This pattern is used throughout the codebase for optional plugin loading. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * style: Fix Prettier formatting for NOSONAR comments Move NOSONAR comments to separate lines to comply with Prettier formatting rules. Format multi-line Route component in useMainAppRoutes.js. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Correct NOSONAR comment placement for SonarQube Place NOSONAR comment inline with catch statement for proper recognition. SonarQube requires the suppression comment on the same line as the issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Add NOSONAR comments to suppress empty catch warnings Add minimal NOSONAR comments to suppress SonarQube warnings for intentional empty catch blocks in plugin loading pattern. These catch blocks are part of the graceful degradation architecture for Cloud-only features. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * path modified admin cusotm plans * UN-2861 [FEAT] Add RequireStaff permission for custom plans administration Add platform staff-only access control for custom Unstract subscription plans: - Add RequireStaff component to enforce platform staff access - Update custom plans route to use RequireStaff instead of RequireAdmin - Block access for open-source deployments (mock_org) Frontend Changes: - New RequireStaff.js component with isStaff and orgName validation - Update useMainAppRoutes.js to use RequireStaff for /admin/custom-plans route - Shows Unauthorized for non-staff users, NotFound for OSS deployments This complements the backend IsStaff permission class to ensure only platform staff can create custom Stripe products with dual pricing structure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove unused RequireStaff component Remove RequireStaff component as it's been replaced with inline staff checking pattern in route files. This avoids component dependency issues and follows the established Verticals pattern. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove RequireStaff dependency from OSS routes Replace RequireStaff component wrapper with inline staff check using useSessionStore in an IIFE. This matches the pattern used in Cloud plugin routes and fixes the build error where RequireStaff component was deleted but still referenced. The inline check ensures: - Staff-only access to admin custom plans route - Hidden in open-source deployments (orgName === "mock_org") - No component import dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix Prettier formatting for staff check return statement * Refactor inline CSS to classes in UnstractAdministrationPage - Create UnstractAdministrationPage.css for fallback UI styling - Replace inline styles with className in UnstractAdministrationPage.jsx - Improves code maintainability and follows project's CSS patterns * Fix React Rules of Hooks violation in useMainAppRoutes - Move useSessionStore hook call to top level of function - Remove IIFE pattern that violated hooks rules - Simplify conditional rendering logic Fixes CodeRabbit review comment about hooks being called inside nested function. --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Rahul Johny <[email protected]>
johnyrahul
pushed a commit
that referenced
this pull request
Nov 14, 2025
* feat: Add admin custom Stripe product creation support This commit adds comprehensive support for admins to create custom Stripe subscription products for both Unstract and LLM Whisperer platforms. ## Frontend Changes ### Router Updates (Router.jsx) - Added dynamic import for LlmWhispererCustomCheckoutPage plugin component - Added public route `/llm-whisperer/custom-checkout` for LLM Whisperer custom plan checkout flow - Follows existing pattern with try/catch for Cloud-only features ### Main App Routes (useMainAppRoutes.js) - Added Unstract administration route at `/administration` - Protected with RequireAdmin wrapper (admin-only access) - Imported UnstractAdministrationPage component ### New Administration Page (UnstractAdministrationPage.jsx) - Plugin-loader pattern with try/catch for Cloud-only component - Falls back to "feature not available" message in OSS builds - Dynamically imports UnstractAdministration from Cloud plugins ## Backend Changes (Already Committed) The backend infrastructure was already added in previous commits: ### Subscription Routes (cloud_urls_v2.py) - Unstract admin endpoint: `/api/v1/unstract/admin/stripe/products/dynamic/` - LLM Whisperer admin endpoint: `/api/v1/llmwhisperer/admin/stripe/products/dynamic/portal/` ### Portal Proxy (subscription_v2/views.py) - `create_dynamic_stripe_product_portal_proxy()` method forwards LLM Whisperer admin requests to Portal service - Follows existing LLMWhispererService pattern for multi-backend architecture - Includes proper error handling and logging ### URL Patterns (subscription_v2/urls.py) - Added `admin_stripe_product_portal_proxy` view and URL pattern - Both endpoints protected with IsAuthenticated + IsAdmin permissions ## Architecture This implementation follows Unstract's plugin-based architecture: - OSS repo contains base routing and plugin-loader patterns - Cloud repo contains actual admin UI components (subscription-admin plugin) - Multi-backend support: Unstract uses local backend, LLM Whisperer proxies to Portal service - Graceful degradation for OSS builds (shows "Cloud-only feature" message) ## Related - Supersedes PR #1087 (monolithic admin UI) - Integrates checkout functionality from PR #1016 - Consolidates router changes from PR #1558 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * chore: Add NOSONAR comments for plugin loading pattern Suppress SonarQube warnings for intentional empty catch blocks used in plugin loading architecture. These catch blocks are part of the graceful degradation pattern for Cloud-only features - when plugins are not available, the component remains undefined and React Router triggers NotFound page. This pattern is used throughout the codebase for optional plugin loading. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * style: Fix Prettier formatting for NOSONAR comments Move NOSONAR comments to separate lines to comply with Prettier formatting rules. Format multi-line Route component in useMainAppRoutes.js. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Correct NOSONAR comment placement for SonarQube Place NOSONAR comment inline with catch statement for proper recognition. SonarQube requires the suppression comment on the same line as the issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Add NOSONAR comments to suppress empty catch warnings Add minimal NOSONAR comments to suppress SonarQube warnings for intentional empty catch blocks in plugin loading pattern. These catch blocks are part of the graceful degradation architecture for Cloud-only features. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * path modified admin cusotm plans * UN-2861 [FEAT] Add RequireStaff permission for custom plans administration Add platform staff-only access control for custom Unstract subscription plans: - Add RequireStaff component to enforce platform staff access - Update custom plans route to use RequireStaff instead of RequireAdmin - Block access for open-source deployments (mock_org) Frontend Changes: - New RequireStaff.js component with isStaff and orgName validation - Update useMainAppRoutes.js to use RequireStaff for /admin/custom-plans route - Shows Unauthorized for non-staff users, NotFound for OSS deployments This complements the backend IsStaff permission class to ensure only platform staff can create custom Stripe products with dual pricing structure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove unused RequireStaff component Remove RequireStaff component as it's been replaced with inline staff checking pattern in route files. This avoids component dependency issues and follows the established Verticals pattern. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Remove RequireStaff dependency from OSS routes Replace RequireStaff component wrapper with inline staff check using useSessionStore in an IIFE. This matches the pattern used in Cloud plugin routes and fixes the build error where RequireStaff component was deleted but still referenced. The inline check ensures: - Staff-only access to admin custom plans route - Hidden in open-source deployments (orgName === "mock_org") - No component import dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix Prettier formatting for staff check return statement * Refactor inline CSS to classes in UnstractAdministrationPage - Create UnstractAdministrationPage.css for fallback UI styling - Replace inline styles with className in UnstractAdministrationPage.jsx - Improves code maintainability and follows project's CSS patterns * Fix React Rules of Hooks violation in useMainAppRoutes - Move useSessionStore hook call to top level of function - Remove IIFE pattern that violated hooks rules - Simplify conditional rendering logic Fixes CodeRabbit review comment about hooks being called inside nested function. * Fix admin route loading by always registering route - Always register admin/custom-plans route (no conditional) - Move staff permission check to UnstractAdministrationPage component - Check permissions at render time when session is loaded - Fixes route registration timing issue This ensures route exists and is accessible to staff users while maintaining security through component-level permission checks. * Add loading state check to UnstractAdministrationPage - Add null check for sessionDetails before authorization - Prevents premature access denial during session load - Addresses CodeRabbit feedback on loading state - Maintains existing orgName === "mock_org" pattern consistent with RequireAdmin and usePostHogEvents 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
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.



What
Code updates to support unstract payments.
Updates:
Why
Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
How
Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
Database Migrations
Env Config
Relevant Docs
Related Issues or PRs
Dependencies Versions
Notes on Testing
Screenshots
Checklist
I have read and understood the Contribution Guidelines.