Skip to content

feat(webhooks)!: a subscription carries a set of topics - #22

Merged
pviti merged 1 commit into
mainfrom
feature/webhook-topics
Aug 25, 2026
Merged

feat(webhooks)!: a subscription carries a set of topics#22
pviti merged 1 commit into
mainfrom
feature/webhook-topics

Conversation

@pviti

@pviti pviti commented Aug 25, 2026

Copy link
Copy Markdown
Member

Follows rail0-gateway#231 / gateway PR #292: topic becomes topics, 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

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>
@pviti
pviti marked this pull request as ready for review August 25, 2026 17:27
@pviti
pviti merged commit 45a3aaa into main Aug 25, 2026
1 check passed
@pviti
pviti deleted the feature/webhook-topics branch August 25, 2026 17:27
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.

1 participant