Skip to content

feat: integrate Stripe for donation payments - #57

Draft
polmichel wants to merge 3 commits into
mainfrom
vibe/stripe-integration-38d659-new
Draft

feat: integrate Stripe for donation payments#57
polmichel wants to merge 3 commits into
mainfrom
vibe/stripe-integration-38d659-new

Conversation

@polmichel

Copy link
Copy Markdown
Owner

Summary

  • Replace PayPal redirect with Stripe checkout integration
  • Add backend DonationController with Stripe session creation
  • Add Stripe configuration (STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, FRONTEND_URL)
  • Update DonationDialog component to use Stripe.js from CDN
  • Load Stripe.js dynamically to avoid npm dependency issues
  • Include webhook endpoint for payment events

Setup Instructions

  1. Create Stripe account at https://dashboard.stripe.com
  2. Get test keys from https://dashboard.stripe.com/test/apikeys
  3. Set environment variables:
    • Backend: STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, FRONTEND_URL
    • Frontend: REACT_APP_STRIPE_PUBLISHABLE_KEY, REACT_APP_API_URL
  4. Configure webhook in Stripe dashboard pointing to /api/donations/webhook

Testing

  • Use test card: 4242 4242 4242 4242
  • Any future date and CVC

Dependencies

  • Backend: stripe Python library (add to requirements.txt if needed)
  • Frontend: Stripe.js loaded from CDN (no npm dependency)

Closes #stripe-integration

@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch 13 times, most recently from 845eacc to e3148bd Compare August 19, 2026 15:14
- Add DonationController with Stripe checkout session creation
- Add Stripe configuration to Config class (STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, FRONTEND_URL)
- Update FlaskApp to include DonationController
- Update DonationDialog component to use Stripe.js from CDN
- Update tests for Stripe integration
- Load Stripe.js dynamically from CDN to avoid npm dependency

This replaces the PayPal redirect with a proper Stripe checkout flow.
- Frontend creates checkout session via backend API
- Backend creates Stripe session and returns ID
- Frontend redirects to Stripe checkout with session ID
- Webhook endpoint for handling payment events (success, failure, etc.)

To use:
1. Create Stripe account at https://dashboard.stripe.com
2. Set STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY in environment
3. Set FRONTEND_URL for success/cancel redirects
4. Configure webhook endpoint at /api/donations/webhook

Closes #stripe-integration

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from e3148bd to 42e75c1 Compare August 19, 2026 17:46
Co-authored-by: polmichel <polmichel@users.noreply.github.com>
polmichel added a commit that referenced this pull request Aug 19, 2026
The donations.py file was accidentally removed in a previous commit,
causing CI to fail with ModuleNotFoundError. This restores the file
with proper formatting and relative imports.

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
polmichel added a commit that referenced this pull request Aug 19, 2026
The donations.py file was accidentally removed in a previous commit,
causing CI to fail with ModuleNotFoundError. This restores the file
with proper formatting and relative imports.

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from e718d9f to c2579ed Compare August 19, 2026 21:15
polmichel added a commit that referenced this pull request Aug 19, 2026
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from c2579ed to 43a74da Compare August 19, 2026 21:23
polmichel added a commit that referenced this pull request Aug 19, 2026
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 43a74da to fd53b4e Compare August 19, 2026 21:27
polmichel added a commit that referenced this pull request Aug 19, 2026
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from fd53b4e to 6148f74 Compare August 19, 2026 21:32
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: add waitFor for async amount display

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 6148f74 to 817c43b Compare August 19, 2026 21:47
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: set process.env before import, add waitFor

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 817c43b to 7aca19f Compare August 19, 2026 21:53
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: add waitFor for async state updates

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 7aca19f to 8f5f23d Compare August 19, 2026 21:59
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: add waitFor for async state updates

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 8f5f23d to ba83d2b Compare August 19, 2026 22:05
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: set process.env in beforeEach

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from ba83d2b to 786fae6 Compare August 19, 2026 22:10
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: use stringContaining for URL matching

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 786fae6 to 0494ae7 Compare August 19, 2026 22:18
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: use regex for amount matching

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 0494ae7 to c8b9744 Compare August 19, 2026 22:26
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: use regex for amount matching, format with prettier

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from c8b9744 to f3a837e Compare August 19, 2026 22:33
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: use regex for amount matching

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from f3a837e to 88aa569 Compare August 19, 2026 22:39
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: use regex for amount matching, format with prettier

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 88aa569 to 914f953 Compare August 19, 2026 22:47
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: set process.env before import, use regex for amount matching

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 914f953 to b106fd8 Compare August 19, 2026 22:56
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: use stringContaining for URL matching

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from b106fd8 to 473e085 Compare August 19, 2026 23:08
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: use combined regex for amount display

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 473e085 to ef60426 Compare August 19, 2026 23:24
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: mock window.fetch and global.fetch

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from ef60426 to 138d58d Compare August 19, 2026 23:35
polmichel added a commit that referenced this pull request Aug 19, 2026
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: use jest.spyOn for fetch mocking

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 138d58d to 6e53f8a Compare August 19, 2026 23:46
Backend:
- Restore donations.py controller that was accidentally removed
- Fix relative import (from ....config instead of from ...config)
- Remove unused ruff noqa directive
- Add FakeConfig to test fakes
- Update test_flask_app.py and test_json_errors.py to pass config
- Fix import ordering for ruff linter
- Use property names (stripe_secret_key) instead of uppercase attrs

Frontend:
- Fix DonationDialog tests: set process.env in beforeEach, use jest.spyOn for fetch

Closes #57

Co-authored-by: polmichel <polmichel@users.noreply.github.com>
@polmichel
polmichel force-pushed the vibe/stripe-integration-38d659-new branch from 6e53f8a to 78d09b9 Compare August 20, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants