Skip to content
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

feat(SaaS): Billing settings screen #6495

Merged
merged 57 commits into from
Feb 18, 2025
Merged

feat(SaaS): Billing settings screen #6495

merged 57 commits into from
Feb 18, 2025

Conversation

amanape
Copy link
Member

@amanape amanape commented Jan 28, 2025

  • Created new /settings/billing screen and payment form
  • Split /settings route and fix styles
  • Create new dev:mock:saas start script to (semi-)simulate a saas environment for the FE only
  • Created two new API methods
    • createCheckoutSession to initiate a payment
    • getBalance to get the user's balance
  • Extend the <SettingsInput /> component
    • Support an onChange prop
    • Placeholder color
  • Create mock billing handlers for use with msw
  • Refactor e2e tests for billing

OpenHands · 5 41pm · 02-18


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:35dacab-nikolaik   --name openhands-app-35dacab   docker.all-hands.dev/all-hands-ai/openhands:35dacab

@amanape amanape marked this pull request as draft January 28, 2025 15:17
@amanape amanape self-assigned this Jan 28, 2025
amanape and others added 6 commits January 30, 2025 16:13
Getting closer. Need to move the code to deploy so there is no backend code in OSS, add a frontend switch so that this is only used in SAAS, and add a whole bunch of unit tests.
@amanape amanape changed the title feat: Stripe payment provider feat(SaaS): Billing settings screen Feb 18, 2025
@amanape amanape marked this pull request as ready for review February 18, 2025 13:46
amount,
},
);
return data.redirect_url;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should issue a 302 redirect from the backend for this... 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not a blocker though)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree, the only thing is that when testing/mocking, msw cannot actually simulate a redirect. This means that when running the FE with e.g., npm run dev:mock:saas, we won't redirect to the test Stripe form.

Not a big deal, technically you can still copy-paste the 302 redirect URL from the network tab when in a mocked env.

Copy link
Collaborator

@tofarr tofarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can trim down the tests slightly, as some of the constraints there are no longer applicable.

Copy link
Collaborator

@tofarr tofarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍰

@amanape amanape enabled auto-merge (squash) February 18, 2025 15:37
@enyst enyst disabled auto-merge February 18, 2025 17:39
@enyst enyst merged commit 2e98fc8 into main Feb 18, 2025
15 checks passed
@enyst enyst deleted the ALL-963/saas-billing branch February 18, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants