feat: multi-step donate drawer with Stripe Elements#17
Merged
Conversation
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a globally accessible, multi-step donation bottom-drawer flow in the Nuxt frontend, including Stripe Elements-based card entry and a temporary server-side mock endpoint to accept donation submissions while the Go backend is pending.
Changes:
- Extended
LfxDrawerto support a bottom-sheet layout (position="bottom") and optional built-in close button suppression. - Added a 3-step donate flow (amount → contact → payment) plus a success screen, opened globally via a Pinia store and wired from the initiative detail header CTA.
- Integrated Stripe Elements via a
useStripe()composable and added a mockPOST /api/donateendpoint for local submission capture.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/shared/types/donate.types.ts | Adds shared types for donation tiers, forms, and submission/record payloads. |
| frontend/setup/runtime-config.ts | Adds a public runtime config entry intended for the Stripe publishable key. |
| frontend/server/api/donate/index.post.ts | Introduces a mock donation POST route that validates and stores submissions in memory. |
| frontend/package.json | Adds @stripe/stripe-js dependency. |
| frontend/pnpm-lock.yaml | Locks @stripe/stripe-js dependency. |
| frontend/app/layouts/default.vue | Mounts the global donate drawer at the app layout level. |
| frontend/app/composables/useStripe.ts | Adds a singleton Stripe loader keyed by runtime-config publishable key. |
| frontend/app/components/uikit/field/field-messages.vue | Fixes Vuelidate typing by switching to BaseValidation. |
| frontend/app/components/uikit/drawer/drawer.vue | Adds bottom positioning, height support, and hideCloseButton prop. |
| frontend/app/components/uikit/drawer/drawer.scss | Adds bottom-drawer styling and makes drawer content relative. |
| frontend/app/components/uikit/checkbox/checkbox.vue | Wraps checkbox input/icon for improved alignment and sizing. |
| frontend/app/components/uikit/checkbox/checkbox.scss | Updates checkbox layout/CSS to match the new structure. |
| frontend/app/components/modules/initiatives/components/initiative-detail-header.vue | Wires “Fund this initiative” CTA to open the donate drawer via store. |
| frontend/app/components/modules/donate/store/donate-drawer.store.ts | Adds Pinia store to control donate drawer open state + initiative context. |
| frontend/app/components/modules/donate/components/donate-drawer-global.vue | Provides a single global mount point for the donate drawer. |
| frontend/app/components/modules/donate/components/donate-drawer.vue | Implements the multi-step donate drawer UI, validation gating, and submission call. |
| frontend/app/components/modules/donate/components/donate-step-amount.vue | Implements tier selection + custom amount entry. |
| frontend/app/components/modules/donate/components/donate-step-contact.vue | Implements donor info collection with Vuelidate validation. |
| frontend/app/components/modules/donate/components/donate-step-payment.vue | Implements Stripe Elements card input and payment method creation. |
| frontend/app/components/modules/donate/components/donate-step-success.vue | Implements the post-submission success/thank-you screen. |
| .claude/skills/uikit/references/components.md | Updates internal component reference docs for the new LfxDrawer API. |
Files not reviewed (1)
- frontend/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| auth0ClientId: process.env.NUXT_PUBLIC_AUTH0_CLIENT_ID || '', | ||
| auth0RedirectUri: `${appUrl}/auth/callback`, | ||
| auth0Audience: `${appUrl}/api/`, | ||
| stripePublishableKey: '', // populated from NUXT_PUBLIC_STRIPE_PUBLISHABLE_KEY |
| initiativeId: body.initiativeId, | ||
| tierId: body.tierId ?? null, | ||
| tierName: body.tierName ?? null, | ||
| amountCents: body.amountCents, |
Comment on lines
+269
to
+273
| submitted.value = true; | ||
| emit('submitted'); | ||
| } catch { | ||
| // Payment step displays its own Stripe error; API errors surface via $fetch | ||
| } finally { |
| type="solid" | ||
| :size="9" | ||
| class="c-checkbox__check text-white" | ||
| @click.stop |
Comment on lines
+20
to
+24
| <p class="text-sm text-neutral-600"> | ||
| Your {{ formattedAmount }} donation to | ||
| <span class="font-semibold text-accent-600">{{ initiativeName }}</span> | ||
| has been processed. | ||
| </p> |
lewisojile
approved these changes
May 14, 2026
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
LfxDrawerwithposition="bottom"andhide-close-buttonprops to support bottom-sheet layoutcardNumber/cardExpiry/cardCvc) for PCI-compliant card entry — raw card data never touches the server; apaymentMethodIdis sent to the backend insteadPOST /api/donateserver route that stores submissions in memory pending the Go backendLfxCheckboxicon alignment and sizingLfxFieldMessagesTypeScript error (Validation→BaseValidation)What's not yet wired
The frontend posts a
paymentMethodIdto/api/donatebut no actual charge is made — that requires the Go backend to callPOST /v1/payment_intentswith the Stripe secret key. A small follow-up todonate-drawer.vuewill be needed to handle aclientSecretin the response (for 3D Secure) once the backend endpoint is ready.Test plan
LfxInputvisual style; "Donate" button is disabled until all three fields reportcomplete; use test card4242 4242 4242 4242, any future expiry, any CVCPOST /v1/payment_methodson each submission