feat(payments): the registry entry carries the tenant payments link, finished (E7a) - #233
Merged
Merged
Conversation
…ng regex (SonarCloud S5852)
|
This was referenced Sep 5, 2026
Merged
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.



Summary
payments_link_url:— the registry entry now carries the tenant's own onboarding page as one finished, opaque URL, emitted besidestripe_account:.provision-tenant.shwill copy intoStripe:PaymentsLinkUrl, which is what the restaurant's own Payments tab links to (frontend #726 / backend #493 already ship the reader).Issue / plan link
Type
featThe shape, and why it is one opaque field
The obvious alternative was to put the raw token in the registry and let
provision-tenant.shconcatenate a base URL. This does it here instead:Base URL comes from
siteUrl()(lib/email.ts) — the one seam every link we send already goes through, runtimeNEXTAUTH_URLfirst — so staging cannot mint links that point at production.No locale prefix, verified rather than assumed
The stored URL is
https://…/onboarding/payments/<token>with no/en/.middleware.tsredirects an unprefixed path to the visitor's own language, so one stored URL serves a Swiss restaurant whose staff read French and whose owner reads German — and baking a locale in would choose for them permanently, in a value copied into a box.env.Measured against a running
next start, with a positive control:Pairing, and the unknown-key question
payments_link_url:is emitted only alongsidestripe_account:, never on its own: with no account there is no onboarding page to point at, and a button that 404s is worse than no button. Same discipline the module and the commission rate already follow.provision-tenant.shextracts registry fields from a fixed tuple (:71-79), so an unknown key is ignored rather than rejected — which is exactly howpayments_commission_bpsexisted in entries before anything read it. I looked for a strict schema check in the deploy repo (git grep -nE "unknown key|additionalProperties|allowed_keys|schema" origin/develop) and found none; the 10 matches forschemaare unrelated, which is the positive control that the grep works.base_domainandpartner_namecarry.For your deploy PR
plus
payments_link_urlin the extraction tuple at:71-79. The value is already absolute and locale-free; nothing needs concatenating, and nothing needs to know what a token is.NFR triage
tenants/registry.ymlin the deploy repo — a private repo whose read access is the same set of people who can already read a box.env. Worth stating rather than leaving implicit; it is the same blast radius (one restaurant's onboarding) in one more place. The rotation story is in this slice's BACKLOG entry.Test plan
typecheck·lint·test:coverage(1133) ·build·check-single-file --allgrep -F) and COMPILED (tsc0) before any result was read:/en/baked into the URL and the trailing-slash trim removed → 2 REDDeploy notes
provision-tenant.sh.