Add thin (v2) event support to Stripe hosting integration (#1465)#1466
Open
normandev92 wants to merge 3 commits into
Open
Add thin (v2) event support to Stripe hosting integration (#1465)#1466normandev92 wants to merge 3 commits into
normandev92 wants to merge 3 commits into
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1466Or
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1466" |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds thin (Stripe v2) event forwarding support to the CommunityToolkit.Aspire.Hosting.Stripe integration by introducing WithThinListen overloads that compose with existing WithListen configuration so both snapshot and thin event families can share a single stripe listen session (and signing secret).
Changes:
- Added
WithThinListen(...)overloads (for bothIResourceWithEndpointsandExternalServiceResource) and guardedlistencommand / secret-watcher setup for composability. - Added unit tests validating thin forwarding args, thin event filtering, and combined snapshot+thin argument ordering.
- Updated README usage guidance and regenerated the public API baseline.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| tests/CommunityToolkit.Aspire.Hosting.Stripe.Tests/AddStripeTests.cs | Adds new unit tests for thin listen behavior and null guards. |
| src/CommunityToolkit.Aspire.Hosting.Stripe/StripeExtensions.cs | Introduces WithThinListen APIs and composes listen/secret behavior across snapshot+thin modes. |
| src/CommunityToolkit.Aspire.Hosting.Stripe/README.md | Documents how to configure thin (v2) event forwarding and combined usage. |
| src/CommunityToolkit.Aspire.Hosting.Stripe/api/CommunityToolkit.Aspire.Hosting.Stripe.cs | Updates generated API baseline to include new exported methods. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1465
Adds thin (v2) event support to the
CommunityToolkit.Aspire.Hosting.Stripeintegration. The Stripe CLI forwards Stripe's v2 event family separately from snapshot events via--forward-thin-to/--thin-events; this PR exposes those through newWithThinListenoverloads mirroring the existingWithListensurface (bothIResourceBuilder<IResourceWithEndpoints>andIResourceBuilder<ExternalServiceResource>targets).Motivating use case: Connect platforms using Accounts v2, where payout activation is signalled by
v2.core.account[configuration.recipient].capability_status_updated— a thin-only event — while classic events (e.g.charge.dispute.created) remain snapshot. Details in the linked issue.Implementation notes:
listencommand argument is now added exactly once per resource (annotation-guardedEnsureListenCommand), soWithListenandWithThinListencompose into a single CLI session:listen --forward-to … --events … --forward-thin-to … --thin-events ….ResolveSecretis likewise guarded: the CLI emits one signing secret per session covering both families, so a single log watcher suffices and the existingWithReference(stripe, …)signing-secret plumbing works unchanged.-t:GenAPIGenerateReferenceAssemblySource; integration README documents the new API.PR Checklist
Other information
AddStripeTests: thin args, thin event filtering, combined snapshot+thin single-session argument order, endpoint-reference target, and null-argument guards. The two pre-existingAppHostTestsintegration tests require a realParameters:stripe-api-keyand fail identically onmainin my environment — unrelated to this change.