GradGather’s donation portal lets alumni turn goodwill into direct financial support for university clubs, scholarships, and social initiatives. The portal lists active campaigns atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/meenalsingh0/GradGather/llms.txt
Use this file to discover all available pages before exploring further.
/donation, then routes contributors through a PayPal-powered checkout. The integration uses the paypal-rest-sdk and supports both sandbox testing and live production modes, controlled entirely through environment variables.
Donation Campaigns
The campaigns page is served atGET /donation and renders donation.hbs. Five campaigns are currently listed, each presented as a .donation-card with a title, a description, and a Donate Now button.
Hackhound Club Hackathon
Support the Hackhound Club in organizing the annual hackathon. Your donation will help cover event costs, participant swag, and more.
Green Earth Initiative
Contribute to environmental conservation with the Green Earth Initiative. Funds will be used for tree planting and waste reduction programs.
Literacy for All Campaign
Help improve literacy rates by supporting the Literacy for All Campaign. Donations will fund educational resources and training programs.
Tech for Kids Foundation
Support the Tech for Kids Foundation in providing technology and educational resources to underprivileged children.
Veterans Support Fund
Assist veterans in transitioning back to civilian life. Your donation will aid in job training and mental health services.
donate(eventName) JavaScript function, which logs the campaign name to the console and redirects the browser to /paymentGateway:
Payment Flow
The full end-to-end PayPal payment sequence involves five routes spread across the front-end redirect and the PayPal REST API callbacks:User clicks Donate Now
The
donate(eventName) function is called with the campaign name. The browser is redirected to GET /paymentGateway.Payment Gateway page rendered
/paymentGateway renders paymentGateway.hbs, which presents a form where the user enters an amount and selects a payment gateway (PayPal, Stripe, Razorpay, or PayU). Submitting the form sends a POST request to /pay.PayPal payment created
The
POST /pay handler in paymentController.js calls paypal.payment.create() with the create_payment_json payload. On success, it iterates over the returned links and redirects the user to PayPal’s approval_url.User approves on PayPal
The user logs in to their PayPal account (or guest checkout) and approves the payment. PayPal redirects back to the
return_url — http://localhost:3000/success — appending PayerID and paymentId as query parameters.Payment executed on success callback
GET /success calls paypal.payment.execute(paymentId, execute_payment_json) using the query parameters from PayPal. On a successful execution the success.hbs view is rendered.Routes Reference
| Method | Path | Description |
|---|---|---|
| GET | /donation | Donation campaigns listing |
| GET | /paymentGateway | PayPal checkout page |
| POST | /pay | Initiate PayPal payment |
| GET | /success | Payment success callback |
| GET | /cancel | Payment cancel callback |
PayPal Configuration
Thepaypal-rest-sdk is configured in src/controllers/paymentController.js using three environment variables:
| Environment Variable | Description |
|---|---|
PAYPAL_MODE | sandbox for testing, live for production |
PAYPAL_CLIENT_KEY | PayPal REST API Client ID |
PAYPAL_SECRET_KEY | PayPal REST API Secret Key |
Payment Payload
Thecreate_payment_json object sent to paypal.payment.create() defines the payment intent, redirect URLs, item details, and total amount:
execute_payment_json using the PayerID returned by PayPal and the same hardcoded total: