Skip to content

fix(website): show Pro's MXN charge, read from Dhanam's catalog - #736

Merged
aldoruizluna merged 1 commit into
mainfrom
fix/website-pricing-mxn-from-catalog
Oct 18, 2026
Merged

aldoruizluna merged 1 commit into
mainfrom
fix/website-pricing-mxn-from-catalog

Conversation

@aldoruizluna

Copy link
Copy Markdown
Collaborator

Summary

janua.dev/pricing shows the managed Pro plan at USD $29/month. The checkout that the Pro path reaches (dashboard billing → Dhanam federation → Stripe MX) charges it in MXN with 16% IVA. Dhanam's public catalog, the pricing authority, publishes that amount:

GET https://api.dhan.am/v1/billing/catalog/janua   (2026-10-18 17:18Z, 200)
pro: prices.MXN.monthly 43000, grossPrices.MXN.monthly 49900, grossPrices.MXN.yearly 478900

So a buyer sees $29 and is charged MX$499 without the page ever naming it.

This PR:

  • adds apps/website/lib/dhanam-catalog.ts: reads GET /v1/billing/catalog/janua (base overridable with DHANAM_CATALOG_URL), takes the IVA-inclusive grossPrices.MXN amount, or derives it with Dhanam's ceil rule when only the net is present. It never throws: a failed read logs [pricing] Dhanam catalog … unreachable|answered <status> and returns null;
  • makes the /pricing route a server component that reads the price (revalidate = 300) and passes it to PricingSection. The page CSP keeps connect-src 'self', so the browser does not call Dhanam;
  • the Pro card adds one line: Charged MX$499/month in MXN, IVA incluido. (or the yearly amount on the annual toggle). If the catalog could not be read it says Charged in MXN with IVA at checkout., never a typed number.

USD figures, plan names, CTAs and the Business/Enterprise cards are unchanged.

Tests

  • apps/website/lib/dhanam-catalog.test.ts: gross from grossPrices, the ceil fallback from the net, missing tier/price → null, formatting, the fetch URL, and null (not a throw) on a 503 or a network error.
  • apps/website/components/sections/pricing.test.tsx: three new cases (monthly, annual toggle, catalog unavailable).
  • Not run locally (no dependency install in this lane); CI runs the website jest suite.

What merging deploys

docker-publish.yml builds and signs janua-website and writes its digest into k8s/overlays/staging/kustomization.yaml. It does not reach production. Note: since #718 the staging overlay is API-only and promote-to-prod.yml offers only component: api, so a website image has no promote path today; production keeps its current pin until one exists (this also applies to #715 and #716).

🤖 Generated with Claude Code

The pricing page shows Pro at USD $29, but Dhanam's checkout charges it in
MXN with IVA (MX$499 a month, MX$4,789 a year in the catalog). The buyer
never saw that amount before the checkout page.

The pricing route now reads GET /v1/billing/catalog/janua on the server
(the page CSP keeps connect-src to 'self'), revalidated every 300 s, and the
Pro card states the MXN amount for the selected interval. A failed read logs
an error and the card says the MXN amount is charged at checkout, with no
stale figure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📚 Documentation checks found issues. Please review the maintenance script output.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Code quality checks found issues. Please review the maintenance script output.

@github-actions

Copy link
Copy Markdown
Contributor

Security Scan Summary

Date: Sun Oct 18 17:36:11 UTC 2026
Commit: 13be264

Scan Results

  • CodeQL: success
  • Python Security: success
  • JavaScript Security: success
  • Secrets Scan: success
  • Container Scan: success
  • DAST ZAP: skipped

@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright E2E Test Results

  • Total: 11
  • Passed: 11 ✅
  • Failed: 0 ❌
  • Flaky: 0 ⚠️
  • Skipped: 0 ⏭️

Full Report

@aldoruizluna
aldoruizluna merged commit 80cb9f2 into main Oct 18, 2026
34 checks passed
@aldoruizluna
aldoruizluna deleted the fix/website-pricing-mxn-from-catalog branch October 18, 2026 23:59
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