Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

Guides & Recipes — Webhooks

Verified signing and verification recipes compiled on .NET 10 (ImplicitUsings=disable, Nullable=enable).

using System;
using EricksonLopez.Webhooks;
namespace Example.WebhooksQuickStart;
public static class WebhookSigningRecipe
{
public static bool SignAndVerify(string webhookSecret)
{
const string payload = "{\"event\":\"invoice.paid\"}";
long timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
string signature = WebhookSigner.ComputeSignature(webhookSecret, timestamp, payload);
return WebhookSigner.VerifySignature(
webhookSecret,
timestamp,
payload,
signature,
WebhookReceiverProtocol.EricksonLopez);
}
}
using System;
using EricksonLopez.Webhooks;
using Microsoft.Extensions.DependencyInjection;
namespace Example.WebhooksQuickStart;
public static class OutboundSenderRecipe
{
public static ServiceProvider BuildSenderProvider()
{
var services = new ServiceCollection();
services.AddLogging();
services.AddWebhooks(options =>
{
options.Timeout = TimeSpan.FromSeconds(10);
options.EnableSsrfProtection = true;
options.MaxPayloadSizeBytes = 1024 * 1024;
options.Protocol = WebhookSenderProtocol.EricksonLopez;
});
return services.BuildServiceProvider(
new ServiceProviderOptions { ValidateOnBuild = true, ValidateScopes = true });
}
}