Skip to content

fix(payment): charge the displayed currency on every Stripe checkout (Play rejection of 1504) - #23604

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/paypricing
Oct 25, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/paypricing

Conversation

@Git-on-my-level

Copy link
Copy Markdown
Member

Summary

Google Play rejected Android production release 1504 (1.0.573) because the subscription price in the purchase flow differs between screens: the paywall shows the catalog's USD price, and Stripe Checkout, with the account's Adaptive Pricing on, charged non-US buyers a converted local-currency amount. Since then Play refuses every automated edit commit (changesNotSentForReview) on every track, which blocks Android releases, including the pendant audio-drop fix already on main.

This PR disables Stripe Adaptive Pricing on every subscription Checkout session (adaptive_pricing: {enabled: false}), not only promo-code sessions (#23557 / #23299). Checkout now charges the price's own currency, which is the currency every paywall shows.

Why this option, not localized paywall prices

  • It fixes the purchase flow on the server. The catalog sells only USD prices (backend/docs/storefront-contract.md). Once this is deployed, every installed Android build, the rejected 1504 included, shows and charges the same USD amount. No client change is needed. The new Android build from main is still needed to resubmit and to ship the audio fix.
  • It is exact. Showing an Adaptive Pricing amount in the paywall would need a preview of Stripe's conversion before a session exists. The rate also moves between the paywall render and payment, so the displayed and charged prices could still differ. Localized pricing done properly means real per-currency Stripe prices in the catalog. That is a pricing decision for a follow-up, not something to rush into a Play unblock.
  • It is proven in production. The same per-session parameter has been live on promo-code sessions since fix(payment): pin promo-code checkout presentment to USD so the $269 minimum passes (#23299) #23557, so Stripe accepts it for subscription-mode Checkout on this account.
  • It needs no Stripe writes or dashboard changes. It also keeps working if someone flips the account-level setting later.

Trade-off: buyers outside the US pay in USD, so their card issuer may add a foreign-transaction fee, and Adaptive Pricing's conversion uplift is lost. Legacy JPY prices still charge JPY, because Checkout charges the price's own currency.

Rollback: revert this PR and deploy the backend. Rolling back restores the mismatch Play rejected, so don't do it while an Android release is in review.

Changes

  • backend/utils/stripe.py: adaptive_pricing: {enabled: false} moved from the promo branch into the base session params.
  • backend/tests/unit/test_payment_promo_adaptive_pricing.py: tests that the pin is set on sessions with a promo code, without one, with a trial and for a returning customer, plus a static check that the pin is unconditional. This replaces the old assertion that promo-free sessions keep Adaptive Pricing.
  • backend/docs/storefront-contract.md: states that checkout charges the currency the sheet shows.

Verification

  • backend/test.sh with BACKEND_UNIT_TEST_FILE_LIST = test_payment_promo_adaptive_pricing.py, test_payment_checkout_trial.py, test_payment_declined_proration.py, test_payment_promotion_codes.py: 33 passed, 0 failed (unit layer, Stripe mocked).
  • Not verified: a live Checkout session. No Stripe calls were made from this lane.

Deploy

Backend only (the backend Cloud Run service serving /v1/payments/checkout-session). It has to be live in prod before the Android resubmission goes to review.

Failure-Class: none

🤖 Generated with Claude Code

Google Play rejected Android release 1504 because the paywall shows USD
while Stripe Checkout, with the account's Adaptive Pricing on, charged
non-US buyers a converted local-currency amount. Disable Adaptive
Pricing on every subscription checkout session, not only promo-code
sessions (#23299), so the charged price matches the price card.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T15:19:59.673778Z 411d9f0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Review round 1 (Luna, FIX-FIRST) has one finding: paid-app Payment Links (create_app_payment_link) still use Adaptive Pricing.

Rebuttal for this PR's scope (the Play rejection):

  • Stripe says Adaptive Pricing is always enabled for Payment Links. There's no per-link API switch, so this PR's per-session parameter can't be applied to them.
  • The Android app never shows a paid-app price before checkout. App.getFormattedPrice() has no caller in app/lib. The app detail page shows only Subscribe, which opens the Stripe page, and that page shows its own (local) price. Android has no displayed-vs-charged mismatch here, so this path isn't part of the Play rejection.
  • The finding is real for Windows desktop, where AppDetailSheet.tsx:322 shows $x and then opens the Payment Link. The fix is to create a Checkout Session per purchase (Adaptive Pricing off, subscription_data.transfer_data to the developer's Connect account, the same app_id metadata and client_reference_id) instead of a static Payment Link. That touches the Connect payment path and the Windows client, so it gets its own PR rather than riding on this Play unblock. It's tracked as a follow-up.

CI: Backend unit shard 4/6 fails only on tests/unit/test_goals_wrapped_firmware_hardening.py (ModuleNotFoundError: models.goal). Main is red on the same file at b1557e3 (run 40205564034, shard 3/6). It reproduces locally on its own and is unrelated to this diff. It's registered as known-red.

@Git-on-my-level
Git-on-my-level merged commit d362b73 into main Oct 25, 2026
56 of 58 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/paypricing branch October 25, 2026 15:33
Git-on-my-level added a commit that referenced this pull request Oct 28, 2026
… (Play currency policy) (#23852)

The Android subscription flow could show a bare dollar symbol, omit the
post-trial charge, or use a different formatter from Checkout. This
change formats the original catalog amount as **US$29.99** (fixture
example) in every locale and keeps the exact selected price ID through
checkout. Annual offers prominently show the full annual charge. No
local prices, currency_options, Stripe catalog changes, account changes,
entitlement changes, merge or deployment are included.

The previous backend-only fix #23604 disabled Adaptive Pricing. It did
not change native/web symbols, backend price_string consumption, trial
disclosure, retention copy, or explicitly pin multi-currency Price
selection. Adaptive Pricing remains disabled; the session now also sets
the selected Price’s original currency and an explicit USD submit
notice.

## Purchase-surface audit

Line references are in this PR. Catalog unit_amount/amount_minor and
currency are price authority; localized copy contains placeholders,
never embedded currency symbols.

| Surface / strings | File:line | Source and resulting behavior |
|---|---|---|
| 7-day offer timeline, today/free-days/end dates |
app/lib/pages/paywall/trial_paywall_page.dart:190 | ARB trial keys +
trialDays=7 + date formatter; end step now includes exact selected
post-trial total/interval |
| All five trial slides (summaries, transcription, speakers, questions,
apps) | app/lib/pages/paywall/trial_paywall_page.dart:323 | ARB
feature-only captions; no independent price or trial amount; sticky
selected-price terms remain visible on every slide |
| Trial monthly/yearly cards, crossed-out annual comparator, annual
savings | app/lib/pages/paywall/trial_paywall_page.dart:252 | Catalog
amount/currency; shared formatBillingPrice for full total and arithmetic
comparator/saving |
| Trial CTA and terms: Try for US$0.00; 7 days free, then US$…/month or
/year | app/lib/pages/paywall/trial_paywall_page.dart:291 | ARB
placeholders + selected catalog currency/amount; switching interval
updates terms and exact checkout ID |
| Outline full annual/monthly total, secondary monthly equivalent,
saving badge | app/lib/pages/paywall/outline_paywall_page.dart:237 |
PaywallPrice shared formatter; full annual charge is prominent; discount
derives from catalog amounts |
| Hosted web paywall monthly/yearly totals and secondary equivalent |
app/lib/pages/paywall/web_paywall_page.dart:61;
web/paywall/index.html:73 | Flutter shared formatter supplies strings in
the host bridge; static page consumes them. Old released hosts retain a
fixed, ISO-safe fallback, including whole JPY |
| 30-day upsell title/body/claim and new recurring-price terms |
app/lib/pages/paywall/trial_upsell_sheet.dart:89 | ARB + trialDays=30 +
selected catalog annual/monthly price; same checkout path |
| Plans sheet v1 monthly/yearly prices, annual summary, management
confirmation | app/lib/pages/settings/widgets/plans_sheet.dart:1292;
:513 | Catalog amount/currency + shared formatter; ignores poisoned
backend price_string and billing_total |
| Plans sheet V2 paid headline and annual summary |
app/lib/pages/settings/widgets/plans/storefront_plans_content.dart:211 |
Raw StorefrontPrice amount_minor/currency + shared formatter; full
annual charge is prominent |
| V2 current-plan line, annual saving offer, annual-change confirmation
| app/lib/models/plan_storefront.dart:283; :351;
app/lib/pages/settings/widgets/plans_sheet.dart:401 | Additive raw
current amount/currency and localized templates; saving_minor and raw
annual amount use the same Flutter formatter. Original rendered fields
remain for installed clients |
| Cancel-flow retention: discounted recurring amount; percent/duration
offer |
app/lib/pages/settings/widgets/cancel_subscription_sheet.dart:209; :287
| Retention API discounted_amount/currency -> shared formatter; ARB
percentage/duration slots; no discount policy change |
| Promo redemption entry, plan selection, cart discount |
app/lib/pages/settings/widgets/plans_sheet.dart:523; :1075 | No separate
promo-price string; exact selected catalog price ID + promotion code go
to checkout/upgrade; Stripe displays the discount separately in the same
pinned currency |
| Plan & Usage chat compute budget (capped and uncapped), accessibility
copy | app/lib/pages/settings/usage_page.dart:836;
app/lib/l10n/app_en.arb:10472 | USD-denominated budget values use
formatBillingPrice;
chatUsageCost/chatUsageCostNoLimit/chatUsedOfLimitCompute contain
formatted placeholders, with no embedded dollar glyphs. Creator payout
threshold copy is outside this purchase flow and unchanged |
| Stripe cart in PaymentWebViewPage |
app/lib/pages/paywall/paywall_checkout.dart:54;
app/lib/pages/settings/payment_webview_page.dart:31;
backend/utils/stripe.py:57 | Hosted Stripe UI owns cart wording/glyphs.
Original selected Price currency is pinned, Adaptive Pricing disabled,
locale=auto for language, and USD is explicit in submit copy. No amount
conversion by customer address |
| Adjacent creator-app Subscribe action |
app/lib/pages/apps/app_detail/app_detail.dart:900;
app/lib/backend/schema/app.dart:562 | Opens an existing creator
PaymentLink; it displays no in-app numeric price. The legacy
getFormattedPrice dollar helper has no callers. This is separate from
the Omi personal subscription catalog; existing links are unchanged |
| Backend v1 price_string and subscription usage prices |
backend/routers/payment.py:562; backend/routers/users.py:1517 | Shared
backend format_money now uses US$; mobile purchase surfaces do not
render price_string |
| Backend V2 storefront/current/offer copy; Free price |
backend/utils/storefront_copy.py:312;
backend/config/storefront_copy_v1.json:90 | USD becomes US$; Free
remains zero with identical benefits; legacy amounts/IDs are unchanged |

## Hypotheses and policy limit

1. **Country-local currency:** confirmed as a policy risk, not proven as
the sole cause of this particular rejection. [Play’s subscription
policy](https://support.google.com/googleplay/android-developer/answer/9900533)
explicitly identifies incompletely localized pricing/currency as a
violation. This PR follows the USD-only ruling. **If rejection repeats,
local pricing is the fallback and needs a separate owner decision.**
Approval is not guaranteed.
2. **Ambiguous symbols:** confirmed in the original native
simpleCurrency helpers, retention formatter, web Intl formatter, and
backend bare-dollar output. A probe against the pinned intl package
rendered $29.99 in en_US/en_CA/en_IN and 29,99 $ in de_DE; the shared
formatter renders US$29.99 in all four. All current purchase displays
now identify USD explicitly.
3. **Other surfaces:** confirmed v1 price_string consumption and missing
post-trial amounts on both trial offers. At the fetched baseline, offer
ARB values already used placeholders (including Try for {price}). The
adjacent Plan & Usage chat-cost ARBs and widget did embed bare dollar
signs; all three affected keys now consume formatted USD placeholders.
The remaining dollar example in CTA metadata is removed. Legacy
PricingOption.priceString stays wire-compatible and has no
purchase-display reader.

Stripe [manual currency
selection](https://docs.stripe.com/payments/checkout/localize-prices/manual-currency-prices)
can select presentment independently of Adaptive Pricing; explicitly
setting session currency overrides that selection.
[locale=auto](https://docs.stripe.com/api/checkout/sessions/create)
follows browser language. Stripe controls glyphs, so a real cart may use
US$, a dollar glyph with USD, or localized USD wording; its
amount/currency must match. Hosted-cart visual verification is a release
acceptance step, not established by mocked session assertions.

## Compatibility and rollout

- Existing subscriptions, retained prices (including JPY),
cancellation/reactivation, plan limits and Free benefits are unchanged.
JPY manage paths display ¥ with whole-yen units; no new JPY checkout is
enabled.
- iOS uses the same Flutter prices and Stripe Checkout subscription
flow. No StoreKit billing / in_app_purchase implementation exists. The
in_app_review plugin does import StoreKit for review prompts only; that
is unrelated to purchasing.
- V2 raw-money/template fields are additive; installed clients retain
their original rendered fields. Deploy the backend before the mobile
build. The coordinator must separately publish web/paywall/index.html
through its existing web-paywall release path.
- This lane does not merge or deploy. Operator steps, including
Codemagic build verification, Play Policy status / Inbox, review
submission, note text, and the separate Play Payments-policy risk, are
in the private run report play-resubmit-steps.md.

## Validation

- Focused backend tests run only via backend/test.sh with a file
selector and BACKEND_PYTEST_WORKERS=4; new tests cover new-buyer USD
catalog selection across en_US/en_CA/en_IN/de_DE, selected session
currency, manual-currency decoys, trial/promo/returning-customer paths,
and retained JPY management.
- Flutter widget tests cover the actual trial card, post-trial copy and
exact checkout handoff across en_US/en_CA/en_IN/de_DE, outline/web
bridge, 30-day upsell, plans, promo redemption, retention, v1/v2 JPY,
and server-string poisoning.
- Rendered production-widget PNG evidence is attached under
[.agent-artifacts/ui-evidence/playcur](https://github.com/BasedHardware/omi/tree/d844a9ab98b2577189c0695899506b086191b1e3/.agent-artifacts/ui-evidence/playcur)
(55 screenshots: 32 widget renders plus 23 native Android captures; all
trial slides/cards, outline, upsell, v1/V2 plans/promo, retention, and
v1/v2 JPY; en_US and en_CA). The native set was inspected with
agent-flutter on Android API 36; the web PNGs use an emulator frame
capture of offline static HTML. All use fixture data and are not
hosted-cart acceptance. No production account access, GCP tier, live
Stripe mutations, Cloud Logging reads or browser automation were used.
- Repository localization check (`python3 app/scripts/l10n.py check`)
reruns flutter gen-l10n and passes: 49 locales, 4298 keys. Strict ICU
audit: all five message keys changed by this PR match English
branches/placeholders exactly in every locale; zero newly introduced
full-catalog mismatches. The full scan also identifies 184 pre-existing
differences across six unrelated keys. Bare-dollar-before-placeholder
scan: zero matches across all ARB values. Creator payout threshold copy
is unchanged.
- Luna independent review complete through d844a9a: no findings
remain after resolving the V2 and Free-card formatter gaps; final
test/evidence changes and the main merge were also reviewed.
- make preflight: all 66 checks passed. PR metadata: all 5 checks
passed. Latest Flutter render/storefront suite: 47 tests passed;
corrected dark-palette captures visually inspected. Billing/usage
follow-up: 58 tests passed, including capped/uncapped USD budgets in all
four locales; four native Plan & Usage captures added. Initial CI found
a stale checkout fixture missing the new Price-read mock; fixed with an
HTTP-level currency assertion. Full Flutter CI on the earlier head had
7,871 passes and one stale annual-switch expectation; both related
expectations are corrected. Final billing/handoff/usage regression: 76
passed. Exact-head CI at d844a9a is terminal green: 44 successful
checks, 22 intentional skips, zero pending/failure/cancelled checks.
Full Flutter suite: 7,890 passed, four skipped in 21:34. The first
exact-head attempt hit the existing 30-minute job cap with no
failed-test event; the same-head rerun passed without changing workflow
limits or test selection.

## Product invariants affected

none

Failure-Class: new

![Trial monthly card and matching
terms](https://raw.githubusercontent.com/BasedHardware/omi/d844a9ab98b2577189c0695899506b086191b1e3/.agent-artifacts/ui-evidence/playcur/019-mobile-android-en-us-trial-month-card.png)
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.

1 participant