Skip to content

Donation Summary & Fee Toggle Component #27

@thaninbew

Description

@thaninbew

Summary:

Create a reusable component that displays donation total with optional transaction fee coverage and a toggle to add/remove the fee.

Behavior:

  • Display base amount and calculated total
  • Show fee breakdown when includeFee is true (e.g., "+$1.68 covers fees")
  • Toggle switch with label + info tooltip linking to processor fee policy
  • Precise fee calculation: fee = (baseAmount * feeRate) + fixedFee
  • Use environment variables (.env) for fees (easy to update if Stripe changes rates), use 2.9% with a fixed fee of .30 for now.
  • All amounts rounded to 2 decimals

Testing:

  • Unit tests for fee calculations (various amounts)
  • Toggle interaction and callback
  • Snapshot for both states

Integration Notes:

  • Should integrate with existing DonationForm component
  • Stripe (as far as I know) doesn't have a way for us to fetch the fee of our transaction so it might be best to hardcode it in this case.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions