-
Notifications
You must be signed in to change notification settings - Fork 1
Add payment processing features and enhance plan status handling #1410
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
Conversation
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.
Pull Request Overview
Introduces comprehensive payment processing capabilities including a new purchasable plan state, payment flow handling, and UI components for checkout functionality. Enhances the plan status system to support payment-related states and refactors status handling across the application.
- Add payment processing with Stripe integration including checkout and webhook endpoints
- Introduce purchasable plan state with conditional UI rendering based on payment availability
- Refactor plan status handling to use a consistent parameter-based approach across components
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/Plan/summary/index.tsx | Adds payment failure handling and conditional rendering for purchasable plans |
| src/pages/Plan/summary/components/PaymentLoader.tsx | New loading modal component for payment processing states |
| src/pages/Plan/summary/components/IntroductionCard.tsx | Adds hardcoded UI for purchasable plan state |
| src/pages/Plan/summary/components/DetailsCard.tsx | Integrates buy button for purchasable plans and updates status handling |
| src/pages/Plan/summary/components/BuyButton.tsx | New component handling checkout flow and payment initiation |
| src/pages/Plan/summary/components/ActivityInfo.tsx | Updates interface to support purchasable property |
| src/pages/Plan/navigation/header/Header.tsx | Updates plan status function call signature |
| src/pages/Plan/index.tsx | Adds payment success handling with placeholder alert |
| src/pages/Plan/hooks/usePlan.ts | Extends plan object with purchasable state based on checkout item availability |
| src/pages/Plan/context/planContext.tsx | Adds payment progress state and checkout item management |
| src/pages/Plan/Controls/index.tsx | Updates plan status function call signature |
| src/pages/Plan/Controls/SaveConfigurationButton.tsx | Updates plan status function call signature |
| src/pages/Plan/Controls/ConfirmPlanButton.tsx | Adds buy button for purchasable plans |
| src/pages/Dashboard/project-items/Plans.tsx | Updates plan status function calls |
| src/pages/Dashboard/SuggestedCampaigns.tsx | Updates plan status function calls |
| src/pages/Dashboard/hooks/getPlanStatus.ts | Refactors to use parameter object and adds paying status |
| src/locales/it/translation.json | Adds empty translation key for paying status |
| src/locales/en/translation.json | Adds translation for paying status and payment modal |
| src/features/api/index.ts | Adds new API endpoints for checkout and payment processing |
| src/common/schema.ts | Updates API schema with new payment endpoints and types |
| package.json | Updates design system dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
104a33a to
17a5575
Compare
fix: update plan status handling and improve payment status translations fix: correct URL paths for payment success and failure redirection fix: add translations for purchasable plan introduction card feat: add checkout endpoint and update plan status type
17a5575 to
7cb79b9
Compare
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.
Pull Request Overview
This PR introduces payment processing capabilities and enhances plan status handling by adding a purchasable state for plans. The changes enable users to purchase plans directly through a checkout process while improving the overall plan status management system.
Key changes:
- Added payment processing features with checkout functionality and payment status tracking
- Enhanced plan status handling to include a new 'paying' status and purchasable plan detection
- Updated UI components to conditionally render payment-related elements based on plan purchasability
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/Plan/summary/index.tsx | Added payment failure handling and conditional rendering of confirmation card based on plan purchasability |
| src/pages/Plan/summary/components/PaymentLoader.tsx | New component for displaying payment processing modal with loading indicator |
| src/pages/Plan/summary/components/IntroductionCard.tsx | Added conditional rendering for purchasable plans with specific messaging |
| src/pages/Plan/summary/components/DetailsCard.tsx | Updated to use new getPlanStatus API and conditionally render buy button for purchasable plans |
| src/pages/Plan/summary/components/BuyButton.tsx | New component implementing checkout functionality with payment processing |
| src/pages/Plan/summary/components/ActivityInfo.tsx | Extended plan interface to support isPurchasable property |
| src/pages/Plan/navigation/header/Header.tsx | Updated to use refactored getPlanStatus function |
| src/pages/Plan/index.tsx | Added payment success handling with URL cleanup |
| src/pages/Plan/hooks/usePlan.ts | Enhanced to fetch checkout item data and determine plan purchasability |
| src/pages/Plan/context/planContext.tsx | Added payment progress state and checkout item management |
| src/pages/Plan/Controls/*.tsx | Updated to use refactored getPlanStatus function signature |
| src/pages/Dashboard/project-items/Plans.tsx | Updated to use refactored getPlanStatus function |
| src/pages/Dashboard/hooks/getPlanStatus.ts | Refactored to accept object parameter and added 'paying' status support |
| src/pages/Dashboard/SuggestedCampaigns.tsx | Updated to use refactored getPlanStatus function |
| src/locales/*/translation.json | Added new translation keys for payment-related UI elements |
| src/features/api/index.ts | Added new API endpoints for checkout and buy functionality |
| src/common/schema.ts | Updated API schema to include new payment endpoints and plan status |
| package.json | Updated design system dependency version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Introduce payment processing capabilities and improve the handling of plan statuses, including the addition of a purchasable state. Update relevant components to reflect these changes and ensure proper status retrieval.