Add paying member opt-in to volunteer onboarding step#980
Merged
Conversation
✅ Deploy Preview for pauseai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Wituareard
marked this pull request as draft
July 15, 2026 15:39
Wituareard
marked this pull request as ready for review
July 16, 2026 11:16
hturnbull93
approved these changes
Jul 16, 2026
hturnbull93
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. I presume we have a webhook in stripe to add the boolean in airtable once they have done that?
Collaborator
Author
|
Yup, the webhooks handler lives in PauseAI/pauseai-automation |
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
Adds an optional "I want to become a paying member" checkbox to the volunteer step (step 3) of the onboarding flow. When checked, submitting the volunteer form opens the Stripe donation page in a new tab and the user advances to the volunteer confirmation step (step 4) as usual, staying within the flow. After completing payment, Stripe redirects the popup to a new
/closeroute that closes the tab automatically (with a fallback message if the browser blocks the close).Context
This opt-in existed in the legacy Tally volunteer form (which redirected to
/submitted→ Stripe withprefilled_emailandclient_reference_idparams) but was lost when the onboarding flow was migrated to the customOnboardingFlow.sveltecomponent. Adding it back was approved on Discord.Changes
src/lib/components/onboarding/OnboardingFlow.sveltebecomePayingMemberstate flag and aSTRIPE_PAYMENT_LINKconstant (same link as/submitteduses).submitWithto take(onStart, onSuccess):onStartruns synchronously during the user's submit gesture and its return value is passed toonSuccess. This lets callers do gesture-gated work (like opening a popup) before the async fetch resolves.onStartopens a blank popup synchronously (window.open('', '_blank')) during the gesture — satisfying iOS Safari and Chrome on iOS, which only allowwindow.openduring a user gesture.onSuccessthen navigates the already-opened popup to the final Stripe URL (withprefilled_emailfrombasics.emailandclient_reference_idfrom the AirtablerecordIdcaptured bysubmitWith, replacing Tally's submission id), and advances to step 4 regardless.submitWithcall sites were updated to the new signature with a no-oponStart./submittedroute is left untouched — it remains for the legacy Tally form only.src/routes/close/+page.svelte(new) — Stripe success redirect target. Callswindow.close()on mount; because the tab was script-opened bywindow.open(), the browser permits it to close itself. If the user navigated here manually (or the browser blocks the close), a fallback "✓ Thanks for your donation! / You can close this tab now." message is shown. The Stripe success URL must be configured tohttps://pauseai.info/close.src/lib/components/onboarding/messages.ts— added theonboarding_become_paying_membermessage to theOnboardingMessagesinterface and both theenanddelocales.docs/join-form-flow.md— documented the newbecomePayingMemberstate, updated the step-machine state diagram and submission flowchart to include theStripe → /closepath, and added a "Paying member opt-in (volunteer step)" section plus a "Stripe success redirect (/close)" section explaining the auto-close behavior and the required Stripe success URL.docs/ONBOARDING_EMBED.md— noted the opt-in is not prefillable via embed URL.TODO
iOS popup navigation: Opening the popup synchronously during the submit gesture works (no confirmation prompt), but navigating the already-opened popup to the final Stripe URL after the async submission resolves does not work under iOS Safari / Chrome on iOS. Needs an alternative approach (e.g. render a Stripe link on the confirmation step that the user taps directly, or pre-build the URL before opening the popup).Resolved: This was a false alarm./closesuccess-redirect route. Action required: set the Stripe payment link's success URL tohttps://pauseai.info/close.How to test
/join(or/embed/onboarding-form)./close, which auto-closes the tab. To test the fallback, navigate to/closedirectly in a non-script-opened tab — you should see "✓ Thanks for your donation!" instead of the tab closing.