Skip to content

Conversation

homanp
Copy link
Collaborator

@homanp homanp commented Jun 5, 2025

This pull request implements the Stripe Portal functionality by adding a button to the homepage that allows users to access their Stripe billing portal.

Changes made:

  1. Added a "Open Stripe Portal" button to the homepage.
  2. Implemented a handleStripePortal function to handle the button click event.
  3. The function makes a POST request to /api/stripe-portal to create a portal session.
  4. On successful response, it redirects the user to the Stripe portal URL.
  5. Added error handling for failed requests.

Note: This PR only includes the frontend changes. A separate PR will be needed to implement the backend API route /api/stripe-portal to create the Stripe portal session.

TODO:

  • Implement the /api/stripe-portal API route to create a Stripe portal session.
  • Ensure that the Stripe customer ID is dynamically fetched for the logged-in user.
  • Add proper authentication to ensure only authenticated users can access the Stripe portal.

Testing:

  • Verify that the "Open Stripe Portal" button appears on the homepage.
  • Click the button and ensure it triggers the handleStripePortal function.
  • Once the backend is implemented, test the full flow to make sure users are redirected to their Stripe portal.

@homanp homanp added the claude Generated by Claude AI agent label Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claude Generated by Claude AI agent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant