GeezerVison is showing github.com — Add Stripe subscription integration for paid storage upgrades by rtibbles · Pull Request #5810 · learningequality/studio
Conversation
rtibbles
commented
Apr 2, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Adds Stripe subscription integration allowing users to purchase additional storage (1–50 GB at $15/GB/year). Uses Stripe Checkout Sessions for payment, Customer Portal for self-service management, and webhooks for lifecycle sync. Storage is additive to admin-granted quotas.
Environment-gated configuration (BRANCH_ENVIRONMENT) ensures non-production deployments automatically use Stripe sandbox keys — no risk of processing real payments on QA/staging.
Includes documentation at docs/stripe_integration.md covering setup, Stripe Dashboard configuration, and local dev workflow with make devserver-stripe.
stripe-upgrade-demo.webm
Reviewer guidance
Testing
- Set up a Stripe sandbox and configure
STRIPE_TEST_SECRET_KEY, STRIPE_TEST_PRICE_ID env vars
- Run
make devserver-stripe to start the dev server with webhook forwarding
- Navigate to Settings → Storage, select a GB amount, and complete checkout with card
4242 4242 4242 4242
- Verify storage total updates and subscription card shows active state
- Click "Manage Subscription" → cancel via the Customer Portal
- Verify the card shows "Subscription Canceling" with the end date
Risky areas
contentcuration/views/subscription.py — webhook handlers: verify idempotency and that customer.subscription.updated correctly syncs quantity after checkout
contentcuration/migrations/0166_add_usersubscription.py — new table, review schema
contentcuration/frontend/shared/mixins.js — bytesForHumans now shows 1 decimal for GB, 2 for TB instead of integers; affects all file size displays at GB+ scale
AI usage
Used Claude Code throughout. Reviewed Stripe best practices via their published AI skill, iterated on the implementation against those guidelines, and verified the UI in-browser using Playwright. Manually tested the full checkout, cancellation, and webhook flows against a Stripe sandbox.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
So far preliminary testing is looking good. A few suggestions, although only one is blocking (and I have not done much code review, just doing a bit of manual QA for happy paths)
Blocking: The default 10 is the only number that works. I'm guessing there is a mismatch on the data type. manually entering any number (including 10) or using the increments doesn't work.
Not blocking: a nice UI improvement would be some small adjustment from "(x10)"/ "Quantity: 10" to (10GB) or something like that
Not blocking: If you have cancelled your subscription, but it hasn't yet expired, it still shows as active. It would be nice to include some slightly adjusted wording here like. "Your subscription will expire on [date]" if it's been cancelled.
And for active subscriptions, "your subscription will automatically renew on [date]"
Out of scope of this PR but should do: update all stripe branding assets to current
Question: if someone has 10 GB worth of storage and they cancel their subscription, what happens on the day after they stop paying for storage? (I am okay with "we will cross that bridge when we come to it" as a response for now. but. just wanted to ask so we can decide intentionally)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
blocking (and impactful non-blocking) feedback resolved, and code is very readable/standard. i did not go over it with a super fine toothed comb but overall: readable, uses KComponents not vuetify, composables -- all good.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
fetchSubscriptionStatus,
|
|
|
createCheckoutSession,
|
|
|
createPortalSession,
|
|
|
} = useSubscription();
|
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
</KButton>
|
|
|
</div>
|
|
|
|
|
|
<Banner
|
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.
Would you please use non-Vuetify replacement StudioBanner?
Note that there will be a visual difference compared to Banner ~ it's intentional.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
:style="{ backgroundColor: $themePalette.grey.v_100 }"
|
|
|
>
|
|
|
<div
|
|
|
v-if="loading"
|
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
@click="handleUpgradeClick"
|
|
|
>
|
|
|
<span class="upgrade-btn-content">
|
|
|
<KCircularLoader
|
MisRob
Apr 6, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Users can purchase additional storage (1-50 GB at $15/GB/year) via
Stripe Checkout, manage subscriptions through the Customer Portal,
and see their subscription status on the Storage settings page.
Environment-gated configuration ensures non-production deployments
use Stripe test/sandbox keys automatically.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.
Approved, and infra is ready with the relevant updates per slack discussion
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
radinamatic reacted with hooray emoji
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Apr 28, 2026
This was referenced Sep 21, 2026
Reviewers
MisRob
MisRob left review comments
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|