feat: ENT-11468-PR : C Updated Interfaces: Stripe helpers#176
Open
shravani-sonata-gottapu wants to merge 2 commits into
Open
feat: ENT-11468-PR : C Updated Interfaces: Stripe helpers#176shravani-sonata-gottapu wants to merge 2 commits into
shravani-sonata-gottapu wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Stripe helper interfaces by enriching subscription checkout metadata from Stripe Product metadata, and by adding “academy” product/price helper functions plus cached “active prices” retrieval paths in the pricing API.
Changes:
- Enrich
create_subscription_checkout_sessionsubscription metadata using Stripe Product metadata whencheckout_intent.stripe_product_idis present. - Add academy Stripe helper functions (
get_academy_stripe_products,get_academy_stripe_product_by_key,get_academy_stripe_prices) and corresponding tests. - Refactor pricing helpers to introduce cached
get_all_active_stripe_prices/get_all_active_academy_stripe_pricesand updateget_all_stripe_pricesto consume the cached list.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| enterprise_access/apps/customer_billing/stripe_api.py | Adds subscription metadata enrichment and academy product/price helper functions. |
| enterprise_access/apps/customer_billing/pricing_api.py | Introduces cached “active prices” list helpers and refactors lookup-key mapping to use them. |
| enterprise_access/apps/customer_billing/tests/test_stripe_api.py | Adds coverage for the new subscription metadata enrichment and academy helper functions; adds tests for trialing subscription lookup. |
| enterprise_access/apps/customer_billing/tests/test_pricing_api.py | Adds coverage for the new cached “active prices” helper functions and additional caching/error-path behaviors. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
==========================================
+ Coverage 86.08% 86.39% +0.30%
==========================================
Files 149 149
Lines 12500 12587 +87
Branches 1194 1207 +13
==========================================
+ Hits 10761 10874 +113
+ Misses 1424 1405 -19
+ Partials 315 308 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
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.
Description:
Interfaces: Stripe helpers
Files changed:
enterprise_access/apps/customer_billing/pricing_api.py
enterprise_access/apps/customer_billing/stripe_api.py
enterprise_access/apps/customer_billing/tests/test_stripe_api.py
enterprise_access/apps/customer_billing/tests/test_stripe_api.py