Scope
POST /sponsorship/checkout — anonymous (sponsors are not members). Creates a Stripe Checkout Session and returns its URL for redirect.
Request
{ "tierId": "…", "billingPeriod": "monthly|annual", "orgName": "…", "contactEmail": "…" }
or, for a custom one-off contribution:
{ "customAmountCents": 50000, "currency": "usd", "orgName": "…", "contactEmail": "…" }
Rules
- Tier path:
mode=subscription with the tier's monthly/annual price id. Custom path: mode=payment with an ad-hoc price-from-amount (sane min/max bounds).
customer_creation=always; prefill org name + email; success URL → {frontend}/sponsors/thanks, cancel URL → /sponsors.
- No Sponsor row is created here — activation happens in the webhook ticket {{S3}} on
checkout.session.completed (pass tierId/orgName through Checkout metadata).
- Endpoint is unauthenticated → validate inputs hard and rate-limit-friendly (no DB writes, no email sends).
Error codes
sponsorship.tier_not_found, sponsorship.invalid_amount, sponsorship.invalid_request
Dependencies
Blocked by #14 (tiers + price ids).
Acceptance criteria
Conventions (project-wide, non-negotiable)
- .NET 9, records for immutable shapes, file-scoped namespaces, primary constructors where they read well. Minimal-API endpoints grouped per module via
IEndpointModule.MapEndpoints.
Result<T> (SharedKernel) instead of exception-driven control flow. Endpoint results map failures to ProblemDetails with the stable error codes listed above — the frontend keys off them.
- Module owns its EF Core
DbContext mapped to its own Postgres schema. Modules never reference each other's internals — cross-module needs go through a public contract interface or an in-process domain event (IEventPublisher).
- All external calls (GitHub, Stripe, Brevo, Cloudinary, Meilisearch) behind interfaces owned by the consuming module.
- Every list endpoint paginated (offset is fine). xUnit tests in
tests/CommunityPro.Tests/<Module>/ following the existing harness patterns (see Members/MembersTestHarness.cs).
Scope
POST /sponsorship/checkout— anonymous (sponsors are not members). Creates a Stripe Checkout Session and returns its URL for redirect.Request
{ "tierId": "…", "billingPeriod": "monthly|annual", "orgName": "…", "contactEmail": "…" }or, for a custom one-off contribution:
{ "customAmountCents": 50000, "currency": "usd", "orgName": "…", "contactEmail": "…" }Rules
mode=subscriptionwith the tier's monthly/annual price id. Custom path:mode=paymentwith an ad-hoc price-from-amount (sane min/max bounds).customer_creation=always; prefill org name + email; success URL →{frontend}/sponsors/thanks, cancel URL →/sponsors.checkout.session.completed(pass tierId/orgName through Checkoutmetadata).Error codes
sponsorship.tier_not_found,sponsorship.invalid_amount,sponsorship.invalid_requestDependencies
Blocked by #14 (tiers + price ids).
Acceptance criteria
Conventions (project-wide, non-negotiable)
IEndpointModule.MapEndpoints.Result<T>(SharedKernel) instead of exception-driven control flow. Endpoint results map failures to ProblemDetails with the stable error codes listed above — the frontend keys off them.DbContextmapped to its own Postgres schema. Modules never reference each other's internals — cross-module needs go through a public contract interface or an in-process domain event (IEventPublisher).tests/CommunityPro.Tests/<Module>/following the existing harness patterns (seeMembers/MembersTestHarness.cs).