← Planning Hub
Phase 4 — Donations + public
Payments Rollout
Stripe is live as of 2026-05-11. Currently gated to admin + leader while leaders shake it down with real cards. Remaining work: open gates to all members, ACH toggle, member announcement, public /donate page (pending church approval). The homepage Donate CTAs shipped 2026-05-12 but are admin-only-visible until launch.
Sections
What's already shipped (test mode)
✓
Phase 1 — Trailman dues
Per-trailman Pay button on
dashboard/family.html, 10-tier proration (Aug→Apr, May–Jul rolls to next year), webhook posts a two-entry ledger row (income + Stripe fee).✓
Phase 2 — Event fees
Tiered pricing per event (Adult / Trailman / Other Child), drop-off support ("I'm not attending"), three attendee modes (open / members-relaxed / closed), payment-required RSVP for paid events.
✓
Phase 3 — One-off charges
Admin creates a payment link, copy / email / SMS to payer, public
/pay/<token> page, scholarship → restricted-donation mapping for donor letters.✓
My Payments page
Member-facing, combines Stripe + manual ledger entries via
getMyPayments Cloud Function. Tax-deductible donation total broken out.✓
Admin Payments page
Groups by Stripe payout, "Mark Payout Cleared" bulk action, per-payment "Refresh Fee from Stripe" button.
✓
ACH bank payments enabled in code
Lower fees, slower settlement. Brett needs to enable in Stripe Dashboard live-mode toggle.
✓
Checklist auto-check for troopDues
Based on
family_members.duesPaidYears — webhook and manual mark-paid both update it.◐
Dues pay link — parents pay a Trailman's dues with no login (built 2026-10-23, awaiting deploy)
On a Trailman's page (
Security: 32-byte random token, only its SHA-256 hash stored in
Scholarship request from the link (added 2026-10-23, same deploy): under the Pay button the page says no family is turned away because of cost and offers Request a scholarship — a short inline form with the dashboard scholarship form's fields (no proof), the Trailman fixed by the link, no login. Server:
Deploy (Brett):
Related weakness, unchanged in this change: the older one-off
trailman.html → Sign-Up Checklist → Troop Dues row) a Dues Pay Link button opens a modal: amount owed today (same proration / additional-child / scholarship / min-age rules as Stripe), Create · Copy · Regenerate · Revoke. Public page /pay-dues/<token> shows the Trailman's first name, family last name, troop year and amount, then Stripe Checkout (card or bank) — nothing else, no PII. Payment posts through the existing dues webhook path (metadata type:'dues' + duesItems), so dues marked paid, ledger rows, receipts and refunds all behave exactly like the Pay Dues button; payerUid is the family head so it shows on their My Payments.Security: 32-byte random token, only its SHA-256 hash stored in
dues_pay_links; collection has no client rules access at all (functions only, rules test dues_pay_links.test.mjs); one active link per Trailman, 60-day expiry, regenerate revokes the old one; amount always recomputed server-side at checkout; token format validated before any read; generic "not valid" for anything that isn't a live link; per-link rate limit + 25-minute Checkout-session reuse.Scholarship request from the link (added 2026-10-23, same deploy): under the Pay button the page says no family is turned away because of cost and offers Request a scholarship — a short inline form with the dashboard scholarship form's fields (no proof), the Trailman fixed by the link, no login. Server:
payDuesLink action requestScholarship writes the same contact_submissions doc the logged-in form writes (shared builder functions/scholarship-request.js; type:'scholarship-request', plus source:'dues-pay-link', duesPayLinkId, trailmanId, familyId, schoolYear) so it shows in Contacts like any other request, and sends the same admin-inbox email (Reply-To the parent). One open request per link (a repeat submit answers "already received", no new doc; archiving the request in Contacts reopens it), 3 requests/hour/link, nothing the parent typed is ever echoed back. getDuesPayLink returns scholarshipRequestPending so a reload keeps showing "Request received"; the Pay button stays. Awarding a scholarship on the Trailman's page needs nothing extra — the link reprices from duesScholarshipCents on every load (tests cover partial, full → nothing owed, and full-with-paid-stamp). Tests: functions/scholarship-request.test.js (unit) + the scholarship section of tests/functions/dues_pay_link.test.mjs (emulator). No rules change.Deploy (Brett):
firebase deploy --only functions:manageDuesPayLink,functions:getDuesPayLink,functions:payDuesLink,functions:stripeWebhook,functions:submitScholarshipRequest, then firebase deploy --only firestore:rules, then hosting:production (adds the /pay-dues/** rewrite + pay-dues.html).Related weakness, unchanged in this change: the older one-off
/pay/<token> links use 8-char Math.random tokens (~41 bits) stored in plain text, and payment_requests allows public get — worth migrating to the same hashed-token pattern.Blocking before going live
1
Flip the admin-only gates → expand to all members
Current state (2026-05-11): Gates are open to admin + leader — leaders are the live-test cohort. The remaining flip is to remove the gates entirely so all members can pay.
Three places marked
Three places marked
// TEMPORARY in the codebase:
functions/index.jscreateCheckoutSession(line ~810): changeverifyAuth(req, ['admin', 'leader'])toverifyAuth(req, null)for dues + event-fee branches. (One-off branch is already public.)dashboard/family.jsrenderDuesBlock: remove theif (currentUserRole !== 'admin' && currentUserRole !== 'leader') return;line so all members see Pay Dues.rsvp.jsrenderForm: remove the gate so all members can pay event fees.
✓
Switch Stripe from test mode → live mode (done)
Live publishable key in
stripe-config.js, STRIPE_SECRET_KEY Firebase secret set, live-mode webhook configured at https://us-central1-grace-trail-life.cloudfunctions.net/stripeWebhook with all required events subscribed (checkout.session.completed · payout.paid · payout.failed · charge.refunded · charge.updated · charge.succeeded · payment_intent.payment_failed), STRIPE_WEBHOOK_SECRET set, stripeWebhook deployed. Leaders can now make real Stripe payments.✓
Clean up test-mode data (done)
Test charges (
paymentIntentId starting with pi_3T…), linked ledger rows, pending-payment RSVPs from incomplete checkouts, test payment_requests, and stale duesPaidYears on family_members all removed. Production Firestore is clean.3
Brett-side tasks (no code)
- Enable ACH in live-mode Stripe Dashboard (Settings → Payment methods → Bank debits → toggle on). Lower fees, slower settlement.
- Member announcement explaining the new payment system — wait until gates are fully open (item #1). Could go out via the Send Broadcast tool.
Phase 4 — Donations + public /donate page
Pending church approval.
Goals: Prominent button on the public homepage (alongside Sign In / Join Us). Standalone landing at
/donate explaining how donations are used + clean Stripe Checkout flow. Tax-deductible (501(c)(3) via GPC), Stripe receipt immediately, qualifies for year-end donor letter.Use-case copy (researched against real Trail Life troop sites)
Authentic categories drawn from Trail Life troops FL-0007 (Tampa), KS-1199, FL-1217, FL-413, OH-1202, MS-1031, MN-1977, plus Trail Life USA's national guidance.
- Scholarships ("camperships") — help families who can't afford dues, registration, or campout fees, so no boy is turned away. Most universally cited category across troops.
- Outdoor and camping equipment — tents, stoves, lanterns, cooking gear, first-aid kits.
- Awards, badges, and patches — Branch pins, Branch Patch components, Forest Award medallion.
- Campouts & Hit-the-Trail outings — site fees, food, transportation, program supplies.
- Special adventure activities — ziplining, high-ropes, climbing, surfing, Summer Adventure week.
- Charter & program fees — the troop's annual Brand Authorization Renewal to Trail Life USA.
- Ceremony & recognition events — Pine Car Derby, advancement, year-end recognition, parent nights.
- Service-project supplies — Operation Christmas Child, community service work.
- Meeting supplies & program materials — craft supplies, printed handbooks, training materials.
Framing the donate page should pick up
- "100% of your gift goes into running our troop — all leaders are unpaid volunteers."
- "Less time fundraising, more time on the trail."
- Christ-centered framing: "raising godly and courageous men," "experiencing God's creation."
- Tax-deductibility note via GPC's 501(c)(3) (EIN on file in
org_settings.taxId).
Avoid: framing donations as funding national HQ · paying leaders/staff · supporting a specific Trailman · bundling in per-Trailman national membership dues.
Implementation outline
- New
donate.htmlat the project root,/donaterewrite infirebase.json(mirrors/pay/). - Index CTAs — done 2026-05-12, admin-only. A "Donate" nav link, a "Support Grace Trail Life" band above the "Ready to Hit the Trail?" CTA, and a footer link — all class
donate-cta, hidden untilbody.tl-admin(set when the signed-in user'srole === 'admin'), pointing atdashboard/donate.htmlfor now. At launch: drop the gate + promote the donate page to a publicdonate.htmlat the root with a/donaterewrite. - Form fields: amount (preset chips $25 / $50 / $100 / $250 / Custom), donor name, email, address (for tax letter), optional restriction picker (scholarship, equipment, etc.), optional "in honor of / in memory of" message, "Cover the processing fee" checkbox default ON for donations (Brett confirmed this earlier — donors absorb the Stripe fee so the troop nets the full amount).
- Backend extension: new
type: 'donation'branch increateCheckoutSession. Nopayment_requestsdoc needed (donations are spontaneous, not invoice-based). Webhook posts ledger rows withcategory: 'donation'and any restriction the donor picked (restricted: true,restrictedPurpose: 'Scholarship Fund'etc. — re-uses the same restricted-donation model the scholarship one-off uses today). - Donor receives a Stripe email receipt automatically; year-end donor letter via existing
dashboard/ledger-donors.jsaggregation. - "Cover the fee" math:
chargeAmount = donorIntent + estimatedStripeFee, recompute server-side. Webhook reconciles actual fee frombalance_transactionas today.
Donate page sections (suggested)
- Hero: short value prop ("Help raise godly, courageous men in our community") + the donate form
- Where Your Donation Goes: 6–9 of the categories above with a sentence each and maybe an icon
- About the Troop: brief reminder of who we are + the Christ-centered mission
- Tax-Deductibility: one paragraph explaining 501(c)(3) status via Grace Presbyterian Church + that a year-end letter is provided for gifts ≥$250
Status note (updated 2026-05-12): A lot of this is already built in admin-only mode — the
dashboard/donate.html page + the donate-upsell on dues, and now the homepage Donate CTAs (nav link, "Support Grace Trail Life" band, footer link — all admin-only-visible, pointing at dashboard/donate.html). Remaining Phase 4 work: the type: 'donation' Checkout branch, moving the donate page from dashboard-only to public, the content sections on it, and flipping the homepage gate off.Optional / nice-to-have polish (not blocking)
⏳
Pending RSVP auto-cleanup
Abandoned Stripe Checkouts leave a pending RSVP doc forever. 24h scheduled cleanup function. Skip until it becomes annoying.
⏳
Editing a paid RSVP
Currently handled via refund + new RSVP. Could build a proper edit flow with delta-cost computation.
✓
Family-link picker on one-off charges
Trailmen are searchable in the payer picker; charge routes contact info to family head + tags ledger row with
payerTrailmanId.⏳
Bulk send payment links
"Everyone owes $50 for the campout" — pull from broadcast page's recipient resolution + batch-create payment_requests.
⏳
CSV export of admin Payments page
For accounting reconciliation. Mirror the ledger CSV export.
✓
payout.failed webhook handler
Persists failure on payouts doc + emails admins. Make sure Stripe Dashboard webhook has
payout.failed in the subscribed events.⏳
Apply for Stripe nonprofit pricing (deferred)
One email to Stripe Support with the IRS determination letter. Drops card fees from 2.9% + $0.30 → 2.2% + $0.30. Brett will pursue this later — not blocking. Once approved, just update the org-settings fee percentage (no code changes; fees are configurable).
Quick test plan when gates open to all members
- As a non-admin user: visit
/dashboard/family.html. Pay Dues button should appear on each unpaid trailman. - Click Pay Dues → real card → return to dashboard → trailman shows ✓ Paid, checklist auto-checks Troop Dues.
- Visit a paid event RSVP page → cost panel + tiered total → submit → real-card payment → RSVP confirmed.
- Admin creates a one-off charge → emails the link → recipient pays → admin sees it in Payments + ledger.
- Wait for real Stripe payout → admin clicks "Mark Payout Cleared" → ledger rows flip to bank-cleared.
- Refund a charge from Stripe Dashboard → confirm webhook reverses correctly.
Last updated 2026-10-23