Repository navigation
fix(billing): let JPY subscribers change plans safely - #23591
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This was referenced Oct 25, 2026
Closed
aryanorastar
marked this pull request as ready for review
October 25, 2026 15:07
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
khoap1220-hue
added a commit
to khoap1220-hue/omi
that referenced
this pull request
Oct 26, 2026
…price IDs Reconcile with BasedHardware#23591 multi-currency Stripe pricing while preserving ledger-derived legacy JPY unlimited price IDs (price_1RtJPm1F8wnoWYvwhVJ38kLb, price_1RtJQ71F8wnoWYvwKMPaGlGY) and strict same-currency upgrade validation.
khoap1220-hue
added a commit
to khoap1220-hue/omi
that referenced
this pull request
Oct 26, 2026
…lan changes (BasedHardware#23584) Rebase onto main after BasedHardware#23591 while preserving ledger-derived legacy JPY unlimited price IDs (price_1RtJPm1F8wnoWYvwhVJ38kLb, price_1RtJQ71F8wnoWYvwKMPaGlGY), explicit currency-boundary helpers, and unit tests.
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.
What changed
An existing JPY subscriber selecting Unlimited in the mobile sheet received a USD price that Stripe rejected. #20804 recognized JPY prices for entitlements but explicitly excluded in-app plan changes. The sheet now shows the approved JPY offer, preserves its formatted total through the generated DTO, and confirms the exact displayed price instead of looking it up in a separate USD catalog.
The canonical catalog explicitly admits the four existing JPY Plus/Unlimited IDs for managing an existing JPY subscription. Resolution checks currency, active state, interval, mode and entitlement version. Stale USD, retired/unbound and nonrecurring targets are rejected before releasing schedules or changing entitlements. Retained prices cannot open new Checkout; the exact current JPY price can reactivate its own pending cancellation, after promotion-code validation. Existing cancellation indicators and desktop/legacy/ladder boundaries remain guarded. No amounts are imported and no production Stripe prices are created or changed.
Old sheets must update before receiving non-USD offers because their annual summary hardcodes USD. The currency capability header and additive response fields are reflected in the generated Dart, Swift and TypeScript clients.
Closes #23584. Related recognition-only work: #20804. Parallel submissions #23592 (@PINYOPATTANAWASANPORN) and #23597 (@khoap1220-hue) were reviewed for consolidation; their useful boundary behaviors are already covered here. No commits were imported from either submission. Coordination and attribution record.
Product invariants affected
none
How it was verified
BACKEND_UNIT_TEST_FILE_LISTwithbackend/test.sh: currency management, JPY recognition, catalog/compiler and immutable entitlements, pricing resilience, proration/decline/cancellation/promotion guards, subscription ingestion, BYOK payment access and v1 storefront-flag independence.backend/:python -m pytest --confcutdir=tests/integration/billing tests/integration/billing/test_jpy_plan_changes_stripe.py -vwith an explicitly supplied standard test key.a37882a71bc9e40e4e7c025bf6f8744a5211b25e(41 passed, 23 skipped, no pending or failed checks). Aryan supplied a final review finding no merge-blocking code issues at this head and reported another 371 backend tests and 29 Flutter tests passing; those reruns were reported by the reviewer rather than repeated by this implementation session.UI evidence
Release and remaining verification
Current-head CI and the supplied final code review have passed. Before production release, an Omi Stripe owner must verify the production JPY prices are active with the expected currency, recurrence, mode and entitlement bindings; personal-sandbox results do not establish the production catalog or this customer's account state. Merge and deploy the backend before releasing the currency-aware mobile app. No production subscriptions/customer data, deployment or app release were changed by this work. Keep the support case open until the customer verifies the displayed JPY price and successful plan change on the released build.
Failure-Class: none
Line-Count-Exception: backend/routers/payment.py | 1846 -> 1934 | Keep currency admission beside existing authenticated subscription and schedule mutations; reusable currency resolution is extracted to utils/billing_currency.py. A broader payment-router split is outside this safety fix and the exception needs maintainer review.