RevenueFlow.Webhooks
0.1.0-alpha.7.2
dotnet add package RevenueFlow.Webhooks --version 0.1.0-alpha.7.2
NuGet\Install-Package RevenueFlow.Webhooks -Version 0.1.0-alpha.7.2
<PackageReference Include="RevenueFlow.Webhooks" Version="0.1.0-alpha.7.2" />
<PackageVersion Include="RevenueFlow.Webhooks" Version="0.1.0-alpha.7.2" />
<PackageReference Include="RevenueFlow.Webhooks" />
paket add RevenueFlow.Webhooks --version 0.1.0-alpha.7.2
#r "nuget: RevenueFlow.Webhooks, 0.1.0-alpha.7.2"
#:package RevenueFlow.Webhooks@0.1.0-alpha.7.2
#addin nuget:?package=RevenueFlow.Webhooks&version=0.1.0-alpha.7.2&prerelease
#tool nuget:?package=RevenueFlow.Webhooks&version=0.1.0-alpha.7.2&prerelease
RevenueFlow.Webhooks
Explicit provider-neutral webhook subscription provisioning. Applications own their HTTPS callbacks, HTTP routes, authentication, authorization and secure signing-secret storage. Providers implement the capability contracts in RevenueFlow.Core; this orchestrator depends only on Core and the atomic store abstractions.
var setup = new WebhookSubscriptionService(documents);
var definition = new WebhookSubscriptionDefinition(
new Uri("https://app.example/webhooks/payments"),
["payment_intent.succeeded"], providerApiVersion: configuredVersion);
var result = await setup.EnsureSubscribedAsync(provider, "stripe-payments", definition, cancellationToken);
// If present, immediately put result.SigningSecret in application-owned secure storage.
Automatic setup requires the provider binding's Create capability. An explicit call first commits sanitized intent, then commits an exclusive expected-revision claim, then issues one remote request with a stable operation ID/idempotency key. Constructors, reads and normal application startup perform no implicit provisioning. Unsupported automatic setup throws before remote submission.
The adapter binding must remain stable across create as well as retrieval. A binding change observed after create throws a setup conflict before confirming the remote ID or returning its signing secret. The durable submitting claim remains uncertain and cannot be automatically resent; reconcile an application-verified candidate through the original binding. Credential rotation that preserves the binding remains supported. Applications must keep binding configuration stable; before/after checks cannot make arbitrary concurrent rebinding atomic or detect changes restored entirely between checks.
RegisterExternalAsync(binding, key, definition, remoteId) records externally or manually configured setup locally. It accepts no provider object and performs no remote calls. External setup remains application managed. Multiple providers and accounts can coexist in one app under separate local subscription keys; no provider is selected globally or per user.
A submitted claim is never automatically resent, including after process loss, timeout or an uncertain store response. Submitting and Unknown results require reconciliation. An explicit ReconcileAsync uses a known remote ID or an application-verified candidate ID and the provider's Retrieve capability; it never creates a remote endpoint. A candidate must match the requested callback, event set, explicitly requested API version and mode, and any returned operation correlation must match. Omitting the API version permits the provider default. Providers without retrieval require external operational recovery. Additional lifecycle operations use the optional capability described below.
Signing secrets are transient [JsonIgnore] values, excluded from durable setup, command receipts, serialized results and ToString. A successful create returns the secret once for immediate secure storage. Replay or retrieval cannot recover it; use the application's secret store. If a remote result is lost, a secret may also be lost and provider-side rotation or recreation may be necessary. A known result with uncertain local confirmation returns its remote ID and transient secret for explicit recovery, while reporting Unknown instead of claiming durable success.
A failed candidate read retains only an already-established remote ID. A missing, mismatched or unavailable candidate cannot bind the setup and prevent later recovery with the correct verified candidate. The provider binding must remain unchanged through retrieval.
Definition limits are an absolute HTTPS callback of at most 2,048 characters without user information or fragment, 1–128 unique ordinal event names (at most 32 KiB total UTF-8) and an optional bounded provider API version. Event types are sorted and copied. Persisted configuration contains the callback and normalized event definitions; avoid putting credentials in callback query strings. The in-memory example provides process-local behavior only; durable safety depends on a conforming store.
Provider webhook lifecycle
IWebhookSubscriptionLifecycleProvider in Core adds optional update/delete/list and exact Found/Absent/Unknown reads. WebhookSubscriptionService.UpdateAsync and DeleteAsync persist a scoped operation and setup fence before a single provider attempt. Reusing an operation ID returns retained state; changed terms conflict. ReconcileOperationAsync only reads remote state. Deleted managed setups retain tombstones and cannot silently recreate under the same key. External registrations remain application-managed and cannot be mutated by these methods.
Stripe, Paddle, RevenueCat and Google Play Pub/Sub implement native lifecycle APIs. Lists have at most 100 items and return sanitized configuration with no signing secrets. Provider cursors are opaque IDs/tokens against fixed API origins; callers page explicitly. RevenueCat lists expose only the configured app/environment. Google lists expose only the configured subscription, and topic/IAM/OIDC identity remain fixed by provider configuration.
RotateSigningSecretAsync(provider, key, operationId, vault) creates a replacement endpoint and stores its transient secret through application-owned IWebhookSigningSecretVault. The vault must encrypt and durably retain each exact context/version idempotently; only its reference enters RevenueFlow's store. Deploy verification for the replacement while retaining the previous secret, then call ActivateRotationAsync with that exact deployed version and vault. The service validates the replacement and claims one retirement of the original endpoint. A lost create response or missing secret leaves the old endpoint active; reconciliation never invents a secret or submits another create/delete. An unknown retirement is reconciled by exact old-ID absence. Overlapping endpoints can deliver duplicate events, so retain commerce inbox/economic deduplication.
No in-place signing-secret API is invented. Stripe/Paddle/RevenueCat use replacement overlap; capacity/provider quotas may block creating a second destination. Google Pub/Sub uses OIDC rather than shared webhook signing secrets and does not advertise rotation. Stripe Connect and application-configured external registrations continue to use external setup. Applications own HTTP endpoints, authorization, secret lifecycle, no-retry/no-redirect HTTP transports and any eventual retirement of unrecoverable orphan replacements.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- RevenueFlow.Core (>= 0.1.0-alpha.7.2)
- RevenueFlow.Stores.Abstractions (>= 0.1.0-alpha.7.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RevenueFlow.Webhooks:
| Package | Downloads |
|---|---|
|
RevenueFlow
RevenueFlow commerce composition with internal administrative issuance. External providers and stores are explicit opt-ins. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.7.2 | 54 | 11/10/2026 |