# Donations Module (MVP Scaffold) This module adds donation goal management and donation intent capture for HumHub spaces. ## Current MVP Features - Space menu entry: **Donations** - Space settings page with: - One-click **Run Donations Setup** - PayPal and Stripe provider settings (including recurring toggles) - Donation goal creation/edit/delete - Public donations page in each enabled space - Stripe checkout session creation for one-time and recurring donations - PayPal one-time order creation and approve redirect - PayPal recurring subscription creation and approve redirect - Stripe webhook processing for checkout completion and transaction state updates - PayPal webhook signature verification and event processing for capture/subscription updates - Donation intent creation and provider checkout metadata storage - Admin history page for transactions, subscriptions, and recent webhook events - Initial database schema for goals, transactions, subscriptions, webhook events, provider config, and blocks ## Install / Update in Container ```bash docker cp /tmp/humhub_rescue_modules/donations humhub:/var/www/localhost/htdocs/protected/modules/ ``` ## Apply Migrations ```bash docker exec humhub php /var/www/localhost/htdocs/protected/yii migrate/up --migrationPath=/var/www/localhost/htdocs/protected/modules/donations/migrations --interactive=0 ``` ## Test Flow 1. Enable module in a Space: `Space > Manage > Modules > Donations`. 2. Open `Space > Settings > Donations`. 3. Click **Run Donations Setup**. 4. Enable at least one provider (PayPal or Stripe) and save. 5. Create one or more donation goals. 6. Configure your Stripe/PayPal credentials in settings. 7. For Stripe, set webhook endpoint from Donations Settings (space-scoped URL), for example: - `https:///s//donations/donations/stripe-webhook` 8. Open `Space > Donations` and submit a donation. 9. Confirm rows are created/updated in `rescue_donation_transaction`. 10. Use **Webhook Simulation Tools** in Donations Settings to validate Stripe/PayPal webhook processing locally. ## Next Implementation Steps - Add stronger webhook secret resolution per space/site - Add admin reporting and transaction history UI