🤖 Prefill public checkout from URL query params (name/email + optional lock)#1234
Open
skvost wants to merge 4 commits into
Open
🤖 Prefill public checkout from URL query params (name/email + optional lock)#1234skvost wants to merge 4 commits into
skvost wants to merge 4 commits into
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
Parses first_name/last_name/email/lock from the URL, validates email,
returns a stable { prefill, lock } for the checkout details form. 🤖
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lock Merges useCheckoutPrefill values into the details setValues effect (buyer + ticket attendees, email_confirmation derived from email) and disables prefilled fields when lock is set. 🤖 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hide the copy-details control when lock is set (locked attendee inputs are disabled, so resetting them was unrecoverable and dropped locked data). Also skip attendee prefill under PER_ORDER collection and document the effect-deps omission. 🤖 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SelectProducts forwards first_name/last_name/email/lock from the event page URL into the order-creation navigation, so query-param prefill survives to the checkout details step (not just direct deep-links). Adds CHECKOUT_PREFILL_PARAM_KEYS as the single source of truth. 🤖 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8c33f4a to
12b21bd
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.

What & why
Integrators that link to or embed the public checkout (a mobile app WebView, a personalized email link) often already know the attendee's name and email, but there's currently no way to pre-fill the checkout "Your Details" form. The fields are controlled Mantine inputs with generated ids, so DOM injection from an embedder is unreliable. This adds opt-in, frontend-only query-param prefill.
Behavior
/checkout/:eventId/:orderShortId/details) readsfirst_name,last_name,emailand prefills the buyer's "Your Details" form (and copies to ticket attendees).email_confirmationis derived fromemail; a malformedemailis ignored. Only thewaitlistparam was read here before, so there's no collision.lock=true(or1) makes the prefilled fields read-only — per-field: a field locks only if its param was provided. When locked, the "copy details to attendees" control is hidden so locked values can't be blanked./event/:id/:slug?first_name=…&email=…&lock=trueworks — not just a direct checkout deep-link.Scope
Frontend-only. No backend, no migrations, no new dependencies, no new translatable strings.
frontend/src/hooks/useCheckoutPrefill.ts— parses/validates the params; exportsCHECKOUT_PREFILL_PARAM_KEYSas the single source of truth.CollectInformation— prefill buyer + ticket attendees, per-field lock, hide the copy-control under lock.SelectProducts— forward the prefill params on the checkout navigation.+inemailmust be percent-encoded (%2B), per normal URL query semantics.npx tsc --noEmitintroduces no new type errors.Testing
Manually verified against a local stack (Docker), driving the real event page → select ticket → Continue → details flow, on both a free and a paid event:
lock=truelock=1lock=false/ other values%2B)+in emaillockwith no fieldsScreenshots: event page with prefill link, and the resulting locked details page (attached below).