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
docker cp /tmp/humhub_rescue_modules/donations humhub:/var/www/localhost/htdocs/protected/modules/
Apply Migrations
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
- Enable module in a Space:
Space > Manage > Modules > Donations. - Open
Space > Settings > Donations. - Click Run Donations Setup.
- Enable at least one provider (PayPal or Stripe) and save.
- Create one or more donation goals.
- Configure your Stripe/PayPal credentials in settings.
- For Stripe, set webhook endpoint from Donations Settings (space-scoped URL), for example:
https://<your-host>/s/<space-url>/donations/donations/stripe-webhook
- Open
Space > Donationsand submit a donation. - Confirm rows are created/updated in
rescue_donation_transaction. - 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
Description
Languages
PHP
100%