Skip to content

Conversation

@fvcci
Copy link
Contributor

@fvcci fvcci commented Sep 4, 2025

FEAT:

  • new google wallet api endpoint: /api/wallet/google/[id]
  • Dynamic card data
  • new env variables:
GOOGLE_WALLET_CLASS_ID=
GOOGLE_WALLET_ISSUER_ID=
GOOGLE_WALLET_SERVICE_KEY_FILE=
image image

TODO:

  • gcloud setup for the deltahacks account
  • google wallet console setup

@vercel
Copy link

vercel bot commented Sep 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
portal Error Error Sep 4, 2025 10:57pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR implements Google Wallet integration for DeltaHacks XII, enabling Android users to save their event tickets to Google Wallet alongside the existing Apple Wallet functionality. The changes introduce a new API endpoint at /api/wallet/google/[id] that generates digital wallet passes with QR codes for event check-in.

The implementation follows Google's Wallet API pattern by creating event ticket classes (templates) and individual ticket objects for each user. The system dynamically pulls user data from DH11Application records to populate pass information including names and creates QR codes that link to user profiles. The integration requires three new environment variables for Google Cloud service account authentication and wallet configuration.

On the frontend, the profile page now displays both Apple and Google Wallet "Add to Wallet" buttons, providing a complete mobile wallet experience across platforms. The backend leverages the googleapis library for API interactions and jsonwebtoken for generating the JWT tokens required by Google's "Save to Google Pay" flow.

The changes maintain the existing application architecture while extending wallet functionality to support both major mobile platforms, ensuring DeltaHacks attendees can use their preferred digital wallet solution.

Important Files Changed

Changed Files
Filename Score Overview
src/app/api/wallet/google/[id]/route.ts 2/5 New Google Wallet API endpoint with security and data accuracy issues
src/pages/profile/[[...slug]].tsx 3/5 Added Google Wallet button to profile page with potential UI layout issues
package.json 3/5 Added Google APIs and JWT dependencies for wallet integration
src/env/schema.mjs 5/5 Added three optional environment variables for Google Wallet configuration
src/utils/assert.ts 5/5 New TypeScript assertion utility for runtime validation with type safety
.gitignore 5/5 Added exclusions for Google service key files and temporary directories

Confidence score: 2/5

  • This PR requires careful review due to security vulnerabilities and data accuracy issues in the core Google Wallet endpoint
  • Score lowered due to missing authentication checks, hardcoded venue coordinates, potential race conditions, and lack of input validation
  • Pay close attention to src/app/api/wallet/google/[id]/route.ts for security fixes and data corrections before merging

6 files reviewed, 3 comments

Edit Code Review Bot Settings | Greptile

Comment on lines +242 to +252
<Link
className="relative block aspect-[110/35] w-full"
href={`/api/wallet/google/${qrCodeId}`}
>
<Image
src="/wallet/google-badge-en.svg"
alt="Add to Google Wallet"
fill
className="pointer-events-none"
/>
</Link>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: The Google Wallet button is placed inside the same flex container as Apple Wallet, causing them to stack vertically. Consider placing them as siblings in the flex container for horizontal layout.

Suggested change
<Link
className="relative block aspect-[110/35] w-full"
href={`/api/wallet/google/${qrCodeId}`}
>
<Image
src="/wallet/google-badge-en.svg"
alt="Add to Google Wallet"
fill
className="pointer-events-none"
/>
</Link>
</div>
<div className="flex-1 relative">
<Link
className="relative block aspect-[110/35] w-full"
href={`/api/wallet/google/${qrCodeId}`}
>
<Image
src="/wallet/google-badge-en.svg"
alt="Add to Google Wallet"
fill
className="pointer-events-none"
/>
</Link>

Comment on lines 9 to 12
export async function GET(
_: Request,
{ params }: { params: Promise<{ id: string }> }
) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing authentication check - anyone can generate wallet passes for any user ID.

@fvcci fvcci self-assigned this Sep 4, 2025
@fvcci fvcci added the enhancement New feature or request label Sep 4, 2025
@fvcci fvcci linked an issue Sep 4, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for google wallet passes

4 participants