read.markets/app/routers
Giorgio Gilestro 83995e96c8 stripe: detect buyer currency at checkout (GBP/USD/EUR)
Pass `currency` to Stripe checkout for first-time buyers so Stripe
picks the matching `currency_options` rate configured on the Price
in the Dashboard (multi-currency Prices: one Price, per-currency
unit_amount). Operator configures the rates on existing Prices
prod_UaZ0xCpCboUGCN/price_*; this commit is the application-side
signal.

Currency precedence: explicit request body > Cloudflare cf-ipcountry
header > Accept-Language locale > GBP fallback. Only honoured when
the user has no stripe_customer_id yet — Stripe locks currency to
the customer record at first checkout, so existing customers keep
their original currency (they can switch via the portal).

Adds 4 tests: sniffed currency on new customer, body override beats
sniff, currency omitted for existing customer, and unit-tests for
the sniffing fallback chain.
2026-05-28 12:42:40 +02:00
..
__init__.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
api.py Revert "i18n: add diagnostic logging to localizer + lang-toggle click path" 2026-05-27 23:55:59 +02:00
auth.py ui: collapsible settings sections + welcome-email + larger auth inputs 2026-05-26 22:32:59 +02:00
chat.py routers: extract chat + ops from api.py 2026-05-27 21:43:17 +02:00
email.py css: split cassandra.css into per-section files 2026-05-28 12:31:29 +02:00
ops.py routers: extract chat + ops from api.py 2026-05-27 21:43:17 +02:00
pages.py log: remove dead _resolve_log_content helper from pages.py 2026-05-27 20:39:28 +02:00
polar_webhook.py stripe: per-cadence cooling-off + manage-subscription button 2026-05-26 20:06:19 +02:00
public.py stripe: wire checkout, customer portal, and webhook for read.markets 2026-05-26 18:45:13 +02:00
stripe_billing.py stripe: detect buyer currency at checkout (GBP/USD/EUR) 2026-05-28 12:42:40 +02:00
sync.py sync: detect orphaned blobs (pepper rotation) + fix AESGCM arg order 2026-05-25 12:49:11 +02:00
ticker_validate.py ticker-validate: add /api/ticker/historical with weekend-walkback 2026-05-27 14:45:52 +02:00
universe.py cleanup: drop stale tombstones and dead config fields 2026-05-27 19:25:33 +02:00