feat(webhooks)!: a subscription carries a set of topics - #22
Merged
Conversation
Follows gateway #231: `topic` becomes `topics` on create, update and the Webhook struct, so four events on one endpoint are one subscription — one shared secret to verify against, one circuit breaker — instead of four of each. `update(topics:)` REPLACES the set rather than adding to it, because that is the only version that can also remove one; the doc says so, since "update" reads like "add" for a collection. The list filter stays `topic:` singular: the question is which subscriptions deliver THIS event, whatever else they also deliver. Adds payments.expired to TOPICS, which the gateway has had and this SDK did not — a never-captured authorization whose window lapsed is its own event, not a flavour of failed. `Array(topics)` on the way out so a bare string still works rather than serialising to something the gateway rejects. 166 examples green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Follows rail0-gateway#231 / gateway PR #292:
topicbecomestopics, so several events on one endpoint are ONE subscription — one shared secret to verify against, one circuit breaker — instead of one of each per topic.Merge order: the gateway first (its responses only speak
topics), then this.See the commit message for what changed here and why.
🤖 Generated with Claude Code