Repository navigation
Offer new buyers the plan price in their local currency (revives #26074), default off - #26841
Conversation
…), default off
Google Play keeps rejecting Android production updates under the Subscriptions
policy ("Currency differences with prominent display price ... appropriately
localized for each country"). #25494 made the Stripe cart match the app's US$
price; the offer page itself still shows US$ to a non-US reviewer.
This brings back kodjima33's #26074 (closed 2026-11-23 in favour of Play
Billing) onto current main as written: buyers with no paid subscription whose
device region has an approved price see and pay that currency through Stripe
currency_options on the same Price IDs. Off until STOREFRONT_LOCAL_CURRENCY
and STOREFRONT_LOCAL_CURRENCY_TABLE are set and the Prices carry the options.
Changes on top of #26074 @ aec826e:
- resolve conflicts with main (Play Billing checkout check, prepaid-code
import, playMinorUnits, trial paywall trialDays);
- stub play_subscriptions_db.is_play_customer in the checkout test helper,
which main's checkout now calls;
- register both switches in config/feature-flags.yaml with a ramp plan.
Failure-Class: FC-subscription-price-presentment-drift
Co-authored-by: kodjima33 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… did not read it
python_reads skips any file whose text has none of getenv, environ, _FLAG_KEY,
_ENV, _COHORT, _HEADER, enabled_env_var or kill_switch. added_read_keys used
the same gated scan on the base version, so when an edit added one of those
tokens to a file that already read a flag (for example
`local_currency.REGION_HEADER` in backend/routers/storefront.py beside its
existing `policy.enabled('LADDER_V1_PRO_GATES_ENABLED')`), the base scan found
nothing and the unchanged read counted as added. The PR then "touched" that
flag and inherited its overdue error, which it cannot remediate.
The base side of the comparison now scans without the token gate. The current
side is unchanged, so no new reads are reported and none are hidden.
Failure-Class: FC-check-scope-exceeds-remediation-scope
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
16 issues found across 58 files
Confidence score: 2/5
offer_forinbackend/utils/local_currency.pytrusts the client-supplied region for price eligibility, so buyers can spoof a country to get its configured local price. Base eligibility on trusted payment or account geography.- In
backend/utils/storefront.py, an unreadable existing subscription currency can leave the offer currency as USD, so the sheet may show foreign USD prices. Preserve the unreadable state and avoid rendering prices until the billed currency is known. - The new manifest check can fail in the release-eligibility caller because it does not install the Node/ICU version required by
generate_checkout_currency_format.py. Add the pinned Node setup to that caller. buildHeadersinapp/lib/backend/http/shared.dartsends the device region to arbitrary download and custom-backend URLs. Restrict the header to Omi authorities or add it only to storefront requests.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/test/widgets/billing_currency_surfaces_test.dart">
<violation number="1" location="app/test/widgets/billing_currency_surfaces_test.dart:67">
P2: This fixture accepts the new `currency` argument but discards it, so the checkout handoff tests cannot verify the new currency contract. Capture currency and assert it with a localized offer test.</violation>
</file>
<file name="app/lib/backend/http/shared.dart">
<violation number="1" location="app/lib/backend/http/shared.dart:235">
P2: `buildHeaders` also serves arbitrary download and custom-backend URLs, so this unconditionally discloses the device’s region to third parties. Restrict the header to Omi authorities (or add it only at storefront callers) so firmware and override requests do not receive location metadata.</violation>
</file>
<file name="backend/scripts/generate_checkout_currency_format.py">
<violation number="1" location="backend/scripts/generate_checkout_currency_format.py:43">
P2: Pinning the table to ICU 77 does not keep it aligned with Checkout’s browser `Intl.NumberFormat`; newer runtimes render five supported currencies differently. Use a formatting source or contract that matches Checkout’s runtime, or avoid promising exact parity for ICU-sensitive currencies.</violation>
<violation number="2" location="backend/scripts/generate_checkout_currency_format.py:126">
P2: The generator relies on the platform default encoding for Unicode artifacts, so Windows users can get `UnicodeEncodeError` or false stale results. Read and write both generated files with `encoding='utf-8'`.</violation>
</file>
<file name="backend/utils/storefront.py">
<violation number="1" location="backend/utils/storefront.py:214">
P2: The local-currency yearly switch still formats its headline, savings CTA, and confirmation amount with `format_money`, so these strings do not match the Checkout-compatible `display_money` output. Pass the selected formatter through all switch-specific formatting paths.</violation>
<violation number="2" location="backend/utils/storefront.py:313">
P2: When Stripe cannot reveal an existing subscriber's billed currency, this branch clears only `current_row` and leaves `offer_currency` as USD, so the sheet can still render foreign USD prices. Carry the unreadable state through tier filtering and show no prices until the billed currency is known.</violation>
</file>
<file name="backend/scripts/local_currency_options.py">
<violation number="1" location="backend/scripts/local_currency_options.py:62">
P2: The apply path does not verify that override IDs are the intended monthly and annual Prices. A swapped or unrelated valid Price can receive the wrong interval's amounts; preflight each retrieved Price's product and recurring interval before any write.</violation>
<violation number="2" location="backend/scripts/local_currency_options.py:119">
P2: `price_ids` silently drops a missing monthly or annual ID, so `--count-non-usd-subscriptions` can return exit 0 with a census for only one Price; the same unvalidated list also permits both plan flags to point at one Price during `--apply`. Require both IDs and reject duplicates before either Stripe mode runs.</violation>
<violation number="3" location="backend/scripts/local_currency_options.py:158">
P3: `_stripe` imports the Stripe SDK inside a function, but backend scripts require imports at module scope. Move `import stripe` into the top-level import block so this script follows the backend import policy.
(Based on your team's feedback about module-scope backend imports.)</violation>
</file>
<file name="app/test/widgets/storefront_checkout_handoff_test.dart">
<violation number="1" location="app/test/widgets/storefront_checkout_handoff_test.dart:38">
P2: This test double discards the new currency argument, so these checkout-handoff tests cannot catch the plans sheet sending the wrong currency or omitting it. Capture `currency` in `_Usage` and assert it in the successful checkout cases.</violation>
</file>
<file name="backend/utils/promotion_redemption.py">
<violation number="1" location="backend/utils/promotion_redemption.py:120">
P2: After this branch accepts a multi-currency fixed coupon, `redeem_promotion_code` still returns the coupon’s base `amount_off` and `currency`, so the redemption response reports the wrong discount for local subscriptions. Return the selected `currency_options[currency]` amount and the subscription currency instead.</violation>
</file>
<file name=".github/checks-manifest.yaml">
<violation number="1" location=".github/checks-manifest.yaml:1428">
P2: This new manifest check will fail in the release-eligibility caller because that caller does not install the exact Node/ICU version required by `generate_checkout_currency_format.py`; add the pinned Node setup to every CI route that can execute this check.</violation>
</file>
<file name="backend/routers/users.py">
<violation number="1" location="backend/routers/users.py:1346">
P2: This passes every available plan into the all-or-nothing currency check, so one legacy/ladder price without a local option suppresses localization for Omi Pro as well. Restrict the offer lookup and rewrite loop to the localized `unlimited_v2` prices, leaving unrelated plans on their existing USD strings.</violation>
</file>
<file name="backend/utils/local_currency.py">
<violation number="1" location="backend/utils/local_currency.py:97">
P2: `load_table` crashes on valid JSON whose `currencies` or `countries` value is not an object, despite promising to drop malformed input. Guard both sections with `isinstance(..., dict)` before calling `.items()` so a bad operator value fails closed to USD.</violation>
<violation number="2" location="backend/utils/local_currency.py:140">
P1: `offer_for` treats the client-supplied region as price authorization, so buyers can spoof a country such as `JP` and obtain its configured local price. Derive eligibility from trusted payment/account geography, or prevent a client region from authorizing a cheaper charge before enabling this flag.</violation>
<violation number="3" location="backend/utils/local_currency.py:267">
P3: This new backend module places `stripe` and `redis_db` imports inside functions. Move them to the module import block to follow the backend module-scope import rule and keep dependency structure consistent.
(Based on your team's feedback about module-scope backend imports.)</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| @override | ||
| Future<Map<String, dynamic>?> createUserCheckoutSession( | ||
| {required String priceId, String? promotionCode, int? trialDays}) async { | ||
| {required String priceId, String? promotionCode, int? trialDays, String? currency}) async { |
There was a problem hiding this comment.
P2: This fixture accepts the new currency argument but discards it, so the checkout handoff tests cannot verify the new currency contract. Capture currency and assert it with a localized offer test.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/test/widgets/billing_currency_surfaces_test.dart, line 67:
<comment>This fixture accepts the new `currency` argument but discards it, so the checkout handoff tests cannot verify the new currency contract. Capture currency and assert it with a localized offer test.</comment>
<file context>
@@ -64,7 +64,7 @@ class _Usage extends UsageProvider {
@override
Future<Map<String, dynamic>?> createUserCheckoutSession(
- {required String priceId, String? promotionCode, int? trialDays}) async {
+ {required String priceId, String? promotionCode, int? trialDays, String? currency}) async {
sessions.add((priceId, trialDays, promotionCode));
return {'error': true, 'status_code': 400, 'detail': 'Fixture: checkout handoff captured'};
</file context>
| 'X-Omi-Plan-Identity': '1', | ||
| 'X-App-Build': PlatformManager.instance.appBuild, | ||
| appChannelHeader: currentAppChannel().wire, | ||
| if (deviceStorefrontRegion() case final region?) storefrontRegionHeader: region, |
There was a problem hiding this comment.
P2: buildHeaders also serves arbitrary download and custom-backend URLs, so this unconditionally discloses the device’s region to third parties. Restrict the header to Omi authorities (or add it only at storefront callers) so firmware and override requests do not receive location metadata.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/backend/http/shared.dart, line 235:
<comment>`buildHeaders` also serves arbitrary download and custom-backend URLs, so this unconditionally discloses the device’s region to third parties. Restrict the header to Omi authorities (or add it only at storefront callers) so firmware and override requests do not receive location metadata.</comment>
<file context>
@@ -231,6 +232,7 @@ Future<Map<String, String>> buildHeaders({
'X-Omi-Plan-Identity': '1',
'X-App-Build': PlatformManager.instance.appBuild,
appChannelHeader: currentAppChannel().wire,
+ if (deviceStorefrontRegion() case final region?) storefrontRegionHeader: region,
...fromHeaders,
};
</file context>
| if (deviceStorefrontRegion() case final region?) storefrontRegionHeader: region, | |
| if (url == null || shouldAttachOmiCredentials(url)) | |
| if (deviceStorefrontRegion() case final region?) storefrontRegionHeader: region, |
| return 1 | ||
| return 0 | ||
| for path, text in outputs.items(): | ||
| path.write_text(text) |
There was a problem hiding this comment.
P2: The generator relies on the platform default encoding for Unicode artifacts, so Windows users can get UnicodeEncodeError or false stale results. Read and write both generated files with encoding='utf-8'.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/scripts/generate_checkout_currency_format.py, line 126:
<comment>The generator relies on the platform default encoding for Unicode artifacts, so Windows users can get `UnicodeEncodeError` or false stale results. Read and write both generated files with `encoding='utf-8'`.</comment>
<file context>
@@ -0,0 +1,131 @@
+ return 1
+ return 0
+ for path, text in outputs.items():
+ path.write_text(text)
+ return 0
+
</file context>
| SAMPLE_MINOR = 1234500 | ||
| # Bump together with .github/workflows/repo-checks.yml's setup-node, then regenerate. | ||
| NODE_VERSION = 'v22.22.0' | ||
| ICU_VERSION = '77.1' |
There was a problem hiding this comment.
P2: Pinning the table to ICU 77 does not keep it aligned with Checkout’s browser Intl.NumberFormat; newer runtimes render five supported currencies differently. Use a formatting source or contract that matches Checkout’s runtime, or avoid promising exact parity for ICU-sensitive currencies.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/scripts/generate_checkout_currency_format.py, line 43:
<comment>Pinning the table to ICU 77 does not keep it aligned with Checkout’s browser `Intl.NumberFormat`; newer runtimes render five supported currencies differently. Use a formatting source or contract that matches Checkout’s runtime, or avoid promising exact parity for ICU-sensitive currencies.</comment>
<file context>
@@ -0,0 +1,131 @@
+SAMPLE_MINOR = 1234500
+# Bump together with .github/workflows/repo-checks.yml's setup-node, then regenerate.
+NODE_VERSION = 'v22.22.0'
+ICU_VERSION = '77.1'
+
+NODE = r"""
</file context>
| lanes: ["local", "ci"] | ||
| reason: "#9843 Ticket 02: macOS-only manifest checks must have an executable CI route" | ||
| - id: checkout-currency-format | ||
| command: ["python3", "backend/scripts/generate_checkout_currency_format.py", "--check"] |
There was a problem hiding this comment.
P2: This new manifest check will fail in the release-eligibility caller because that caller does not install the exact Node/ICU version required by generate_checkout_currency_format.py; add the pinned Node setup to every CI route that can execute this check.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/checks-manifest.yaml, line 1428:
<comment>This new manifest check will fail in the release-eligibility caller because that caller does not install the exact Node/ICU version required by `generate_checkout_currency_format.py`; add the pinned Node setup to every CI route that can execute this check.</comment>
<file context>
@@ -1424,6 +1424,12 @@ checks:
lanes: ["local", "ci"]
reason: "#9843 Ticket 02: macOS-only manifest checks must have an executable CI route"
+ - id: checkout-currency-format
+ command: ["python3", "backend/scripts/generate_checkout_currency_format.py", "--check"]
+ triggers: ["backend/scripts/generate_checkout_currency_format.py", "backend/config/checkout_currency_format.json", "app/lib/utils/checkout_currency_format.dart", ".github/workflows/repo-checks.yml", ".github/checks-manifest.yaml"]
+ lanes: ["local", "ci"]
</file context>
| return | ||
| prices = [price for plan in response.available_plans for price in plan.prices] | ||
| try: | ||
| offer = local_currency.new_buyer_offer( |
There was a problem hiding this comment.
P2: This passes every available plan into the all-or-nothing currency check, so one legacy/ladder price without a local option suppresses localization for Omi Pro as well. Restrict the offer lookup and rewrite loop to the localized unlimited_v2 prices, leaving unrelated plans on their existing USD strings.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/routers/users.py, line 1346:
<comment>This passes every available plan into the all-or-nothing currency check, so one legacy/ladder price without a local option suppresses localization for Omi Pro as well. Restrict the offer lookup and rewrite loop to the localized `unlimited_v2` prices, leaving unrelated plans on their existing USD strings.</comment>
<file context>
@@ -1335,6 +1335,27 @@ def _byok_unlimited_subscription(
+ return
+ prices = [price for plan in response.available_plans for price in plan.prices]
+ try:
+ offer = local_currency.new_buyer_offer(
+ platform, region, lambda: users_db.get_stripe_customer_id(uid), [price.id for price in prices]
+ )
</file context>
|
|
||
|
|
||
| def _stripe(key_env: str): | ||
| import stripe |
There was a problem hiding this comment.
P3: _stripe imports the Stripe SDK inside a function, but backend scripts require imports at module scope. Move import stripe into the top-level import block so this script follows the backend import policy.
(Based on your team's feedback about module-scope backend imports.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/scripts/local_currency_options.py, line 158:
<comment>`_stripe` imports the Stripe SDK inside a function, but backend scripts require imports at module scope. Move `import stripe` into the top-level import block so this script follows the backend import policy.
(Based on your team's feedback about module-scope backend imports.) </comment>
<file context>
@@ -0,0 +1,165 @@
+
+
+def _stripe(key_env: str):
+ import stripe
+
+ stripe.api_key = os.environ[key_env]
</file context>
| @@ -0,0 +1,376 @@ | |||
| """Local-currency offers for new buyers (Google Play Subscriptions policy). Default off. | |||
There was a problem hiding this comment.
P3: This new backend module places stripe and redis_db imports inside functions. Move them to the module import block to follow the backend module-scope import rule and keep dependency structure consistent.
(Based on your team's feedback about module-scope backend imports.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/utils/local_currency.py, line 267:
<comment>This new backend module places `stripe` and `redis_db` imports inside functions. Move them to the module import block to follow the backend module-scope import rule and keep dependency structure consistent.
(Based on your team's feedback about module-scope backend imports.) </comment>
<file context>
@@ -0,0 +1,376 @@
+
+def retrieve_with_options(price_id: str) -> Any:
+ """A Stripe Price with its ``currency_options`` (not returned unless expanded)."""
+ import stripe
+
+ return stripe.Price.retrieve(price_id, expand=['currency_options'])
</file context>
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
…one locale Panel F1 (review-20261201t012244-67c6): the region came only from the device locale, so a buyer, or a Play reviewer, in a table country whose phone says en-US or names no country still saw US$. On Android the app now reads Play's billing country for the account (InAppPurchasePlatform.countryCode, the market Play itself prices in) once, before the first price screen loads (available plans and the v2 plans sheet), and sends it in X-Omi-Storefront-Region. It is read lazily, as PlayBilling already does, so app start never connects to Play; any failure or 3 s timeout keeps the locale region. Also from the same review: - F4: a table whose currencies or countries field is not an object now falls back to USD instead of raising at checkout. - F2: shared_test asserts buildHeaders sends the region header, prefers Play's country, falls back to the locale and reads Play once. Failure-Class: FC-subscription-price-presentment-drift Co-Authored-By: Claude Opus 5.5 <[email protected]>
…retries a failed read Panel F1 fix check (review-20261201t012244-67c6, luna): falling back to the device locale when Play's country was unavailable reintroduced the mismatch F1 named, and a failed read was cached so it never retried. On Android the storefront region is now Play's billing country or nothing (today's USD); a failed, timed-out or empty read is retried by the next price screen; a success is kept. iOS, desktop and web still send the locale region. Failure-Class: FC-subscription-price-presentment-drift Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
REVIEW: SHIP (fixed) ce5824e (omi-panel review-20261201t012244-67c6, review cap 1/2 money). F1 accepted and fix-checked PASS by luna: Android sends only Play's billing country, with no locale fallback and a retry after a failed read. F4 and F2 fixed in the same commit set. F5 is a precondition for ramp step 5 (all), and F3 and F6 are deferred as minor. Billing change: David merges. |
…es (kill switch: off) David 2026-12-01: ship local-currency pricing on by default rather than as an operator setting, so a later release, config cleanup or rollback cannot drop it silently and reopen the Play Subscriptions finding. Prod now serves STOREFRONT_LOCAL_CURRENCY=android and the price table; `off` is the kill switch. Nothing changes for buyers until the two Omi Pro Stripe Prices carry the matching currency_options (a separate, David-approved write): until then every buyer falls back to USD, logged. Builds without the region header keep USD. The table is #26074's 53-country, 33-currency first rollout plus the ten it dropped (IN INR, PK PKR, EG EGP, NG NGN, AR ARS, TR TRY, UA UAH, BD BDT, KE KES, IS ISK), priced from open.er-api.com USD rates of 2026-12-01 00:02Z with the existing table's rounding (x.99 under 1,000; nearest 50 to 9,999; nearest 5x10^n above). A test loads the rendered prod value and proves all 63 countries and 43 currencies survive validation. Failure-Class: FC-subscription-price-presentment-drift Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
|
/approve-ui ce5824e |
|
/approve-ui 184a9a6 |
|
Scoped review of the on-by-default delta No blocking findings. Verified: with the switch on and USD-only Stripe Prices, no path displays or charges a non-USD amount (plans and subscription routes fall back to USD; checkout uses the base USD Price unless it verified a local option). The overlay and rendered YAML table match exactly (63 countries, 43 currencies), all 86 amounts pass Deferred minors:
|
…igh-volatility currencies (#26877) David 2026-12-01: support local prices only in the major countries where we have buyers and where Google Play is likely to review, and drop the high-volatility, high-risk currencies. Done before the Stripe currency_options write, because those entries are effectively permanent once added. Prod table: euro (21 countries), GBP, JPY, CAD, AUD, NZD, CHF, SGD, MXN, BRL, AED, INR. Amounts unchanged from #26841. Dropped: ARS, TRY, NGN, EGP, PKR, UAH, BDT, KES, ISK, COP, CLP, PEN, ZAR, IDR, PHP, THB, MYR, VND, KRW, TWD, HKD, ILS, QAR, SAR, PLN, CZK, HUF, RON, SEK, NOK, DKK. Buyers there keep USD, as today. Failure-Class: FC-subscription-price-presentment-drift Co-authored-by: Claude Opus 5.5 <[email protected]>
…en at the largest text size (#26791) ## Problem At the largest iOS text size the free trial paywall breaks. The brand cuts to "O...", "Today" in the timeline stacks one letter per line next to its date, and on a 375x667 phone the footer overflows (Privacy Policy is cut, the page body gets no room). Gotcha 12 in the MUX pipeline README logged this on 2026-10-28. The round 2 build of this PR also showed plan cards breaking mid-word at AX5 ("Mont/hly", "US$/29./99"). ## Decision Nik chose option A on 2026-11-30, which overrides the round 1 review's no-clamp finding. At the largest text sizes, the price and the buy button stay on the first screen, even if they draw slightly smaller than the system text size. ## Change `app/lib/pages/paywall/trial_paywall_page.dart`. Everything below applies at accessibility text sizes only (scale >= 1.6, iOS AX1 and up), except the busy-button fix, which applies at every size. The default text size otherwise keeps main's widgets. - The offer is pinned at the bottom at every text size, as on main. Inside it, the price line, Start Free Trial and Terms/Privacy stop growing at a 1.7x cap (before fitting). At AX5, body text there draws at up to 29 pt instead of 53 pt. Before main's per-month copy, 1.7x was the most at which the German renewal line and the button fit in half of a 320x568 screen. Terms/Privacy scroll inside the footer under the button when they do not fit. The price line and button never scroll. If a translation is still too tall, they shrink together as one block, so the button is never tappable with the price line cut off. With main's longer per-month yearly line, this fit shrink triggers in the 320x568 AX5 widget tests for German (0.78 of the cap) and Arabic (0.68), still above the default text size; it did not visibly trigger in the native simulator captures (17 Pro and SE). - Above the footer, the headline and body text keep the full system text size. The "Omi Pro" brand, the Restore label, and plan names and prices may scale down to fit their slot (see below). The cancel note and code hint scroll with the page, as on main. - Plan cards stack at accessibility sizes. Plan names and prices stay on one line and scale down to the card if needed, so no word or price breaks. - The timeline date goes on its own line under the row body. The "Omi Pro" brand scales to its slot instead of cutting off. - The button keeps its size while checkout is pending, failed or retrying, at every text size including default (round 3). - Removed: round 2's offer at the end of the scroll and its first tap that scrolled instead of buying. Money: the CTA still binds to the shown offer. The double-tap lock and the provider's in-flight guard are unchanged, and so are prices and the Play paths. ## Impact estimate Owners who pay: 29.77% -> 29.78-29.83% (MODELED). - A = 29.77%: ACTUAL, `runs/2026-11-30/metrics.json` (3467 paid of 11646 observed owners, Oct 31 to Nov 30). - Reach is MODELED: PostHog has no text-size property, so the share of trial paywall viewers at accessibility sizes is unknown. Trial-start and trial-to-paid lift are MODELED from the brief's range. ## Evidence iOS simulator (iOS 26.4), iPhone 17 Pro and iPhone SE (3rd gen), offline backend with live Stripe prices, built at e61a5b5 (merge with main; same tree as the current head minus the evidence commit). Every frame opened. Raw frames: `~/mobile-ux-agent/runs/2026-11-30/p1/r6/` and round 5 `~/mobile-ux-agent/runs/2026-11-30/p1/sim/r5/`. Largest text (AX5), first screen with no scroll. Left: main a4c0f74 (round 5, before main's per-month copy) for comparison. Then this change on iPhone 17 Pro and iPhone SE: the whole price line sits right above a whole "Try for US$0.00", Terms and Privacy below.  Default text, iPhone 17 Pro: main a4c0f74 (round 5) | this change. Default keeps main's layout, now with main's per-month yearly price line.  Largest text in German, Arabic and Japanese (17 Pro, SE each), system glyphs:  Plan switch at the largest text: scrolled to the cards and picked Monthly then Yearly (German SE), Monthly (Arabic 17 Pro, Japanese SE). The pinned price line follows the selected plan; card prices stay on one line.  Round 5 on the pre-merge head 2d9a45e also covered close, reopen, relaunch, Close/Restore pinned and the Terms/Privacy round trip on both phones (`~/mobile-ux-agent/runs/2026-11-30/p1/result.txt`, "Simulator r5"). ## Merge with main (round 6) Main's per-month pricing copy (#26841) conflicted in `trial_paywall_page.dart`. The merge keeps this PR's stacked plan cards and pinned footer with main's per-month price, percent saving and yearly terms line. That line is longer, so on small phones at AX5 it can take the footer's safety shrink (German 320x568: 0.78, Arabic: 0.68 of the 1.7x cap), still above the default text size, per option A. The real-font test now allows that shrink with a floor at the default size, and counts Arabic vowel marks as part of their word in the plan-card check. ## At ship - No flags, no new events, no copy changes. ## Tests - `app/test/widgets/trial_paywall_real_font_test.dart` uses SF Pro and covers en/de/ar/ja on 402x874 and 375x667 with Face ID insets, and 375x667 and 320x568 with home-button insets, at 200% and AX5. On the first frame with no scroll: the price line is whole, on screen and right above the button; the footer is at most half the screen; the price line and button are laid out at the 1.7x cap before fitting, and after the fit shrink their drawn scale stays at or above 1.0x (the default size); the headline keeps the system scale; one tap starts checkout. - The same file also covers: Terms and Privacy open from the footer without moving the button; no plan-card word or price breaks across lines; through a pending, then failed, then retried checkout the CTA rect and scroll offset stay put (the price line rect is checked after the failure), and a second tap while pending starts nothing (AX5 at 320x568 and 375x667, plus default size); at default size the brand ellipsizes, the footer is unclamped, the cards sit side by side and the notes are pinned. - Mutation checks: with stacking and fit off, the plan-card cases fail; without the scale cap, the first-screen cases fail. - After the merge: the four trial paywall test files, 144/144 pass on Flutter 3.44.5 (before the merge, 37 paywall, billing, plan and trial files: 588/588). `check_mobile_ux_contract`, `check_mobile_ui_isolate` and `check_brand_ui` are clean. ## Not verified - Dark appearance: with iOS set to dark, this paywall renders light, on main and here alike (not changed by this PR). - Arabic and Japanese in widget tests use square fallback glyphs. These are wider than SF Arabic, so the footer and card measurements for them are pessimistic. For Arabic plan-card footnote words wider than a line in squares, the test skips the word check. - Android at its largest font size: not verified. The layout tests force the iOS platform and inject linear text scalers, and no Android device or emulator was shot. - Outside this PR: at AX5 the German headline still breaks mid-word ("So funk/tioniert") at full system scale, as it does on main. ## Product invariants affected none ## Failure class (fixes) Failure-Class: none UI-Evidence: see the images above (.agent-artifacts/ui-evidence/mux-2026-11-30-trial-paywall-ax)
On by default (David, 2026-12-01)
Prod serves
STOREFRONT_LOCAL_CURRENCY=androidand the full price table (backend/deploy/runtime_env/prod.overlay.yaml). Kill switch: setSTOREFRONT_LOCAL_CURRENCY=off. David chose on by default so a later release, config cleanup or rollback cannot drop local prices silently and reopen the Play Subscriptions finding.What a buyer sees after this merges, step by step:
local currency <cur> unavailable)scripts/local_currency_options.py --table <prod table> --apply --confirmall(iOS, desktop, web)X-Omi-Storefront-Region(panel F5)Clean metric:
local currency <cur> unavailablelines fall to zero after step 2. Checkout sessions charge the displayed amount, and there are no currency refunds or tickets. Rollback:off. New buyers go back to USD, and subscribers already billed in a local currency keep it (Stripe fixes a customer's currency).Price table: 63 countries, 43 currencies
This is #26074's 53-country, 33-currency first rollout (below), plus the ten it dropped. They're priced from open.er-api.com USD rates of 2026-12-01 00:02Z, using the existing table's rounding: x.99 under 1,000, nearest 50 up to 9,999, nearest 5×10ⁿ above. All pass
_valid_amount, and a test loads the rendered prod value whole. #26074 did not record why these ten were removed (volatility, card acceptance or something else). David approves the full table with this PR.ARS and TRY lose value fast against USD. Their amounts need a periodic review, and a change is a new
currency_optionsamount plus a table edit.What changed and why
Google Play rejected Android (com.friend.ios) again on Nov 21 for version code 1605: "Currency differences with prominent display price ... appropriately localized for each country". Its evidence is the trial paywall priced in US$ for a reviewer outside the US. The three earlier fixes (#23852 adaptive pricing off, #25494 pinned
CHECKOUT_LOCALE) made the Stripe cart match the app's USD price; the offer page itself still showed US$ to a non-US buyer, which Google's Subscriptions policy lists as a violation ("language and currency are not localized to the user's country").This adds a local-currency offer for buyers with no paid subscription. It is off by default and changes nothing until both a switch and a price table are set.
/v1/users/me/subscriptionprice strings, the Stripe cart and its trial line), and Checkout charges the same Stripecurrency_optionsentry on the same Price ID.currency_options, or whose amount differs from the table, is logged (local currency <cur> unavailable on <price> ...) and that buyer gets USD, so a config mistake cannot open a Checkout in a currency the Price lacks.currencyand the Price'scurrency_options[that currency],utils/local_currency.pybilled_option_amount), never from the switch or the table, so a rollback or table edit cannot tell a GBP subscriber "US$269.91 a year" while Stripe bills £. That subscriber keeps the currency in available plans, interval change (schedule phases pinned to it), the Plans current card, the trial-ending push, promo redemption, the retention offer and billing analytics. If the Price cannot be read the surface shows no amount (no push, no current price, a 503 on plan management), never a guessed one. The yearly and monthly switch offers refuse non-USD subscriptions, as before.buyer_currency,new_buyer_offer): a lapsed USD customer in a table country stays in US$; a lapsed GBP customer who moved to the US sees and pays £ when the Prices carry GBP, independent of the switch; a customer currency the Prices lack keeps today's US$ path. First-time buyers with the switch off read nothing new; the customer read happens only once an offered Price carries a non-USD option.utils/promotion_redemption.py_check_local_currency_eligible): a minimum stated in the subscription currency (directly or inrestrictions.currency_options) is compared with the option amount; a minimum stated only in the Price's own currency (the USD-only bundle and prepaid codes) is compared with the same Price's USD amount, because it is the same plan, so those buyers can redeem and are not charged at trial end because the code was refused; a minimum in any other currency is refused; a fixedamount_offcoupon needs an amount in the subscription currency (Stripe cannot apply a USD amount there); percent-off codes, including 100%, always apply.Turning it on (operator steps, not part of this PR)
backend/scripts/local_currency_options.py --table table.jsonprints the exactstripe.Price.modify(... currency_options=...)calls for the two Omi Pro prices. It is a dry run; only--applywrites, and that was not run.STOREFRONT_LOCAL_CURRENCY=android(first rollout;alladds iOS/desktop/web,offor unset is today).STOREFRONT_LOCAL_CURRENCY_TABLE= one JSON object:{"countries": {"<ISO 3166-1 alpha-2, upper>": "<ISO 4217, lower>", ...}, "currencies": {"<iso 4217>": {"monthly": <int>, "annual": <int>}, ...}}, e.g.{"countries": {"JP": "jpy", "GB": "gbp", "DE": "eur", "FR": "eur"}, "currencies": {"jpy": {"monthly": 4800, "annual": 43200}, "gbp": {"monthly": 2299, "annual": 20699}, "eur": {"monthly": 2699, "annual": 24299}}}. Amounts are Stripe minor units: zero-decimal currencies in whole units (JPY 4800 = ¥4,800, KRW, VND, CLP and the rest of Stripe's list), three-decimal in thousandths, HUF/TWD/ISK/UGX in hundredths and whole hundreds. Many countries may share a currency; a country mapped tousdis the US price. Entries Stripe or the cart cannot represent (not a Stripe currency, not whole hundreds for HUF/TWD/ISK/UGX, a fraction ISK/UGX cannot display) are dropped with a warning at read time.currency_optionsamount equals the table amount for both intervals; otherwise USD (logged), never mixed.Investigation
Every price string that reaches a client
GET /v1/payments/available-plans,backend/routers/payment.py:497unit_amount,price_string,billing_totalfromformat_money_localized_pricing_options,payment.py:684)GET /v2/payments/plans,routers/storefront.py:119,utils/storefront.pybuild_single_plan_storefrontheadline_free= "US$0" (config/storefront_copy_v1.json)utils/storefront.pybuild_storefront,current_line(utils/storefront_copy.py)/v1/users/me/subscriptionavailable_plans[].prices[].price_stringrouters/users.py:1296utils/stripe.py:213,utils/trial_reminder.pycheckout_trial_termsCHECKOUT_LOCALE='en-GB'currency= local, localeen(renders the same glyph as the app), local trial lineutils/trial_reminder.pytrial_ending_reminder_bodyunit_amount(base USD on a multi-currency Price)utils/retention_offer.pyevaluateutils/yearly_switch.py:30,utils/monthly_switch.py:40SWITCH_CURRENCIES={'usd'}reason='currency')app/lib/utils/billing_price.dart(only formatter; every surface calls it with the server's currency),app_en.arbdescriptions only (examples, not values)US$,¥, elseCODE 1.00app/lib/models/subscription.dart,yearly_switch.dart,trial_paywall_page.dart,storefront_plans_content.dart,paywall_checkout.dart,monthly_switch_sheet.dart,payment_issue_row.dartandcancel_subscription_sheet.dartalready format throughformatBillingPrice(amount, currency)with ausdfallback only when the server sends no currency, so no other app surface hardcodes US$. Server-side copy (format_money) is unchanged for every existing response; the local path useslocal_currency.display_money, the same string the app renders.Existing subscribers' strings with the switch off (review item 7).
formatBillingPricenow renders every currency as Checkout does, which changes the string for currencies other than USD and JPY (for exampleCAD 29.99becomesCA$29.99). That is intended, because it is the cart's own text, and it cannot reach anyone today: the plan catalog and the management bindings contain only USD and JPY Prices (test_released_currencies_reach_the_app_unchanged_with_the_switch_off), and USD and JPY render byte for byte as before (US$29.99,¥4,800; app test "USD and JPY render exactly as before"). Keeping two formatters for a switch the app cannot see would be the larger change.Display string = the Checkout render. Stripe Checkout formats amounts with the browser's
Intl.NumberFormatin the session locale, which the server pins:en-GBfor USD (US$, #25494),enfor every other currency (local_currency.checkout_locale).backend/scripts/generate_checkout_currency_format.pyrenders all 138 Stripe presentment currencies through Node's ICU (77.1, CLDR 47) at that locale and writes the symbol prefix, display decimals, Stripe exponent and a sample tobackend/config/checkout_currency_format.jsonandapp/lib/utils/checkout_currency_format.dart. The serverdisplay_moneyand the appformatBillingPriceare both tested against every sample character for character, NBSP included (AED\u00a0109.99,¥4,800,₩39,000,CLP\u00a027,990,HUF\u00a010,990.00,NT$990.00,ISK\u00a03,999,UGX\u00a0110,000,KWD\u00a01.234).--checkfails when either output is stale. The generator refuses to run on anything but Node v22.22.0 with ICU 77.1 (ICU 78 renders HUF, COP, IDR, PKR and RSD differently) and is registered in.github/checks-manifest.yaml(checkout-currency-format, local and ci lanes); the CI hygiene job installs exactly Node 22.22.0.Country signal. Read, not guessed: the backend never reads a client IP or geo header (
routers/public_shared_conversation_chat.py:165,pusher/main.py:130),backend/chartsandbackend/deploydeclare no load-balancer request headers, and the live prod backend services behind api.omi.me (custom-domains-api-omi-me-backend-*,prod-omi-backend-api) have nocustomRequestHeaders(gcloud compute backend-services list, read-only). So there is no trustworthy server-side country today. The primary signal is the device region the new app sends asX-Omi-Storefront-Region(system locale country,app/lib/utils/storefront_region.dart, added inapp/lib/backend/http/shared.dart). It needs no permission or native code and every build after this one sends it. An old app sends nothing and gets today's behaviour. It is user-settable, so it can only choose among prices Nik approved; the follow-up that would make it match where the reviewer physically is would be a GCP LBX-Client-Region: {client_region}header, a prod infra change outside this PR.Stripe price shape. The live Omi Pro prices (
STRIPE_UNLIMITED_V2_MONTHLY_PRICE_ID2999 USD/month,..._ANNUAL_PRICE_ID26991 USD/year) carrycurrency_options={'usd'}only (pipeline snapshot fetched withexpand[]=currency_options).currency_optionsis returned only when expanded, so every local read usesexpand=['currency_options'](local_currency.retrieve_with_options). Checkout already pinscurrencyto the session and disables adaptive pricing (utils/stripe.py); with a multi-currency Price,currency=<local>selects that option, so the cart charges exactly the option amount.What else assumes USD
items[0].price; the subscription's owncurrencyis the billed one. Every reader ofitems[0].price.unit_amounttherefore needs the option amount: trial reminder, retention offer, promo redemption, analytics MRR, Plans current card. All handled behindlocal_currency.billed_in_option, which is false unless the subscription currency is in the approved table, so older Adaptive Pricing conversions keep today's handling.utils/promotion_redemption.pycomparedminimum_amountagainst the base USD amount. For an option-billed subscription it now requires the minimum in that currency (minimum_amount_currencyorrestrictions.currency_options) against the option amount, and refuses a fixedamount_offcoupon without an amount in that currency. At Checkout, Stripe evaluates the code in the session currency.routers/payment.pyrefused any target whosecurrencydiffers from the subscription. It now accepts the same multi-currency Price when it has the subscription's option and pins both schedule phases to that currency.price_for_currency(..., allow_options=...)only offers options when the current item itself is option-billed, so legacy JPY subscribers (JPY-native prices) are unaffected.utils/observability/subscription_events.pyemitsmrr_centsonly for USD; an option-billed subscription now reports its own currency and no USD MRR.backend/scripts/finops/pull_stripe.pystill books byprice.currencyand would count an option subscription at its base USD list price; not changed here (offline finops, follow-up).routers/users.pylegacyprice_stringis not rendered by the Flutter app.Not handled (revenue reporting books local subscribers as USD)
These read the subscription item's Price (
currency,unit_amount), which is the base USD Price for a subscription billed through a currency option, so a £/¥ subscriber is counted as US$29.99 / US$269.91 and never in a non-USD bucket. Left for a follow-up; they should readsubscription.currencyand, when it differs, the Price'scurrency_options[subscription.currency]:backend/scripts/finops/pull_stripe.py:123-126(monthly_amount) and:313-333(currency = p.get("currency"),mrr_usd), feedingcontracts/product-telemetry/bigquery/plan-revenue-mrr.sql.web/admin/lib/stripe-subscriptions.ts:105-132(monthlyAmount,isNonUsdon the item price) and:318-349(wall metrics, FX by item currency).web/admin/app/api/omi/subscriptions/route.ts:93-96(item price amount and currency).Handled here:
backend/utils/observability/subscription_events.pyemits no USDmrr_centsand the subscription's own currency whenever the subscription currency differs from its item Price.Money-safety review (changed lines near price selection, checkout and entitlement)
backend/utils/local_currency.py(new):offer_for,approved_amount(Stripe option must equal the table),billed_in_option,option_amount_for,checkout_locale,display_money.backend/utils/stripe.pycreate_subscription_checkout_session: newlocal_currency_code; retrieves with options, raisesValueError('local_currency_unavailable')when the Price lacks that option (the router decided approval or customer currency), setscurrency,locale, trial terms amount, "All amounts are in". USD path unchanged.billed_option_amount/OptionLookupFailed/UNKNOWN_CURRENCY(Stripe-only subscriber currency),buyer_currency/new_buyer_offer/customer_currency(customer currency first),cached_price_with_options(5-minute cache for the new-buyer and subscriber gates; Checkout re-reads live).backend/routers/payment.py:CreateCheckoutRequest.currency;_new_buyer_checkout_currency(same rule as the offer pages, read live) and the displayed-currency check before session creation (400 when the currency the app showed differs from the one the server would charge; 503 on Stripe read failure);checkout_options['local_currency_code']only when local. Available plans:billed_in_option,allow_options, new-buyer localize (USD otherwise). Upgrade: option-currency gate and schedulecurrency. Trial-will-end webhook: Stripe read moved tostripe_executorfor option-billed trials only.backend/utils/billing_currency.pyprice_for_currency(allow_options=...).backend/routers/storefront.py: new-buyer sheet vianew_buyer_offer(USD otherwise);_subscription_billing_currencyreads the subscription currency (cached 30 days, it never changes) only once the current Price carries a non-USD option, and returnsUNKNOWN_CURRENCYon a read failure so the current card shows no price.backend/utils/storefront.py:offer_currency/moneythreading;build_single_plan_storefront(local_currency_code=...)returns None when any price lacks its option.backend/utils/promotion_redemption.py,utils/retention_offer.py,utils/trial_reminder.py,utils/observability/subscription_events.py: option-billed branches.config/plan_catalog.jsonare untouched; the same Price IDs are sold.createCheckoutSession(currency:)sends the currency the reader saw from every paywall and the Plans sheet.First-rollout price table (#26074's 53 countries, now committed as part of the prod table)
Loaded through
utils.local_currency.load_table()from~/mobile-ux-agent/runs/2026-11-22/play/storefront_local_currency_table.first_rollout.json: 53 countries, 33 currencies (INR, ARS, TRY, NGN, EGP, PKR, UAH, BDT, KES and Iceland removed), 0 entries dropped (scripts/local_currency_options.pydropped_entries). Display strings aredisplay_money, identical to the app and the Checkout render (NBSP after letter codes):Dry run of the Stripe write (no
--apply; nothing sent)Offline, no key, prints
dropped entries: none. It would make exactly these two calls, adding 33 currencies to each Price:Operator sequence (parent runs it; read-only first):
STRIPE_READ_API_KEY=<read key> python scripts/local_currency_options.py --count-non-usd-subscriptionscounts live (active, trialing, past_due, unpaid, paused) subscriptions on the two Prices whose currency is not USD, by currency (older Adaptive Pricing conversions; a manual option overrides Adaptive Pricing for that currency).STRIPE_API_KEY=<write key> python scripts/local_currency_options.py --table <file> --apply --confirmreads both Prices withexpand=currency_options, prints the existing options, and exits 2 before any write if the table dropped an entry or a table currency already exists on a Price with a different amount; otherwise it adds only the missing currencies.Earlier proposed price table (superseded by the table above)
Omi Pro is US$29.99/month and US$269.91/year (9 × monthly). Rates: open.er-api.com, 2026-11-23 00:02 UTC. Converted, then rounded to Play's local price patterns (x.99; JPY to ¥100; MXN to whole pesos ending in 9), with annual = 9 × local monthly re-rounded so the yearly saving stays "3 months free". The JPY row equals the existing JPY Omi Pro management prices (¥4,800 / ¥43,200). Play's own template prices include VAT/GST where prices are tax-inclusive (EU, GB, AU, JP); Stripe Checkout here collects no tax, so these are tax-exclusive like the US price. Nothing below is in the default config.
"jpy": {"monthly": 4800, "annual": 43200}"gbp": {"monthly": 2299, "annual": 20699}"aud": {"monthly": 4499, "annual": 40499}"cad": {"monthly": 4299, "annual": 38699}"mxn": {"monthly": 56900, "annual": 511900}"aed": {"monthly": 10999, "annual": 98999}"eur": {"monthly": 2699, "annual": 24299}"brl": {"monthly": 17799, "annual": 160199}Verification (this revival, on main @
0736f7075d0)Backend:
bash test.shon the 73 billing-related unit files (payment, checkout, storefront, Stripe, promotion, retention, trial reminder, Play Billing, currency, subscription events and more) underomi-heavy: all pass except, at first,test_local_currency_offer.py::test_checkout_currency_equals_the_displayed_currency. Main's checkout now callsplay_subscriptions_db.is_play_customer, which the PR's helper did not stub. After the stub, the file passes 48 of 48.App:
flutter analyzeon every changed Dart file: no issues.flutter teston the billing, paywall, Plans sheet, storefront and Play Billing tests: all pass after one fix. Main'splay_billing_plans_sheet_test.dartfakecreateUserCheckoutSessionlacked the newcurrencyparameter and did not compile; that test now passes 92 of 92.Local manifest checks (
run_checks.py --lane local --base origin/main): all pass except two.checkout-currency-formatneeds Node 22.22.0 with ICU 77.1. This host has 22.23.2 with ICU 78.2. Rerun with the checksum-verified pinned Node:--checkpasses.feature-flag-registryblamed this PR forLADDER_V1_PRO_GATES_ENABLED's overdue deadline because of a checker bug. AddingREGION_HEADERtorouters/storefront.pymade the checker count that file's unchanged LADDER read as new. This branch carries the fix commit (fix(flags): count a Python flag read as added only when the base file did not read it), which is also its own PR,fix/flag-registry-base-scan-gate. Whichever merges second picks it up from main. With the fix:feature-flag registry: OK.The original PR's verification and its iOS simulator evidence follow.
Backend:
bash test.shon the 22 touched/related suites (payment, checkout trial, promo/adaptive pricing, currency changes, JPY recognition, storefront x3, trial reminder, retention, promo redemption, yearly switch, billing events, available plans, users subscription boundary, referral checkout) plus the newtests/unit/test_local_currency_offer.py(48 tests): all pass. New tests cover: switch off / empty / malformed table byte-identical (available plans, v2 sheet, users subscription); JP, GB, DE paths; country outside the table keeps USD on Android and iOS; table currency missing from the Price falls back to USD and logs; old app (no region); US and USD-country buyers; Stripe option missing or not equal to the table; checkout currency equals displayed currency and refuses a mismatch; table validation for zero-decimal and whole-hundreds currencies; every Stripe currency's display string; a local trial keeps its currency through Checkout, an in-trial interval change and the reminder; cart currency, locale, adaptive pricing off and trial line; promo minimum and amount-off in GBP; yearly switch refusal in GBP; retention offer in GBP; local subscriber available plans + interval change with schedulecurrency; local subscriber Plans card; legacy JPY subscriber sheet unchanged; dry-run script prints and never writes; review round 1: rollback with switch off and empty table keeps a GBP subscriber in GBP on available plans, the Plans card, the retention offer, the trial push and promo redemption (and shows no price when Stripe is unreadable); a lapsed USD customer in GB stays USD on the page and at Checkout; a lapsed GBP customer in the US gets GBP with the switch on and off; a customer currency the Prices lack keeps USD; USD-only promo minimum compared with the USD Price;--applyneeds--confirm, prints existing options, refuses a different amount or dropped entries before writing and adds only missing currencies; read-only non-USD subscription count; released currencies unchanged with the switch off.Pyright on the touched backend modules: 0 errors (it caught a variable collision in
build_storefrontduring development).App:
flutter testfull suite (10,045 passed; the two visual-audit files failed to compile on a missed fake and pass after the fix;capture_cold_mute_testfailed once under load and passes alone), newtest/unit/local_currency_price_test.dart,flutter analyzeon changed files (one pre-existing info).Simulator (iOS, pipeline lane
sim, local backend + Stripe stub with a GBP option, switchallbecause the simulator is iOS):UNVERIFIED
The display strings are ICU's render at the pinned locale, the engine Checkout's browser formatter uses, not a live Checkout page: creating a session writes to Stripe. A browser on an older ICU could differ in rare symbols. Check one test-mode session per table currency before turning the switch on.
Whether Google's reviewer device locale names their country. If their device reports
en-US, they still see USD (as Play would for a US account). An LBX-Client-Regionheader would remove that dependency.Android build not run on a device or emulator here; the iOS simulator exercises the same Dart paths.
Trial conversion and renewal in the local currency rest on Stripe's rule that a subscription's currency is fixed at creation and every invoice bills that currency's option of the item Price. The tests prove Checkout creates the trial in the local currency and that no later path (interval change during the trial, schedule, upgrade) changes it; they cannot run Stripe's invoicing.
Stripe accepting
currencyon SubscriptionSchedule phases for an option-billed subscription is from the API reference, exercised only against fakes.That Stripe refuses a Checkout whose currency differs from the customer's
currency, and thatCustomer.currencyis set after a trial-only subscription, are from the API reference; the customer-currency rule avoids both cases but was not run against Stripe.A new buyer entering a USD-minimum or USD
amount_offcode in a local-currency Checkout: Stripe evaluates it in the session currency and may refuse it there. The in-app path for bundle and prepaid codes is redemption after the trial starts (promotion_redemption.py, handled above); list the live codes'restrictionsread-only before turning on.Whether existing
currency_optionscan be edited or removed after--apply(the docs disagree); the script never edits one, and the 5-minute cache assumes they do not change.Reviewer region (the risk that matters most for Play). Since panel F1, the Android app sends Google Play's billing country for the account (
InAppPurchasePlatform.countryCode), read before a price screen loads. If Play doesn't answer within 3 s, the app sends no region, so the buyer gets today's USD; it never guesses from the locale. The next price screen retries. This matches the market Play itself prices the reviewer in, even when the phone's locale names another country. The table leaves out INR, PKR, EGP, NGN, ARS, TRY, UAH, BDT, KES and ISK. A reviewer whose Play country is one of those still sees US$. This PR is as written at David's request; widening the table is a follow-up decision.Play Payments policy. Selling a digital subscription through Stripe in the Android app, without an alternative-billing program, is a separate Play Payments exposure (fix(billing): pin Checkout's locale so the cart shows the app's US$ price #25494, Google Play Billing for new Android subscriptions, behind ANDROID_BILLING (default off) #26078). Google has not cited it so far. Play Billing (deploy(billing): turn on Google Play Billing for Android builds 1617+ (unblocks Play review) #26826) remains the fallback.
Line-count exceptions
Line-Count-Exception: backend/routers/payment.py | 2546 -> 2648 | the checkout currency check and available-plans localization sit on the routes that create Checkout; the decision logic itself lives in utils/local_currency.py
Line-Count-Exception: backend/routers/users.py | 2923 -> 2945 | /v1/users/me/subscription must localize its own price strings for the same buyer
Product invariants affected
backend/deploy/runtime_env.yamlis a locked path for it. This PR adds only two billing settings to the prod backend service (STOREFRONT_LOCAL_CURRENCY,STOREFRONT_LOCAL_CURRENCY_TABLE) and changes no memory intake, consolidation or promotion setting.Failure class (fixes)
Failure-Class: FC-subscription-price-presentment-drift
🤖 Generated with Claude Code