Handle Mollie Webhooks in ASP.NET
developmentThe Mollie.Api.AspNet package provides built-in attributes to automatically parse and validate incoming webhooks (supporting both Classic and Next-gen beta systems). Use the [FromMollieWebhook] attribute on your controller action parameters and the [ServiceFilter(typeof(MollieSignatureFilter))] attribute to ensure the request is authentic.
[HttpPost("full/specific")]
[ServiceFilter(typeof(MollieSignatureFilter))]
public Task<ActionResult> WebhookWithSpecificType([FromMollieWebhook] FullWebhookEventResponse<PaymentLinkResponse> data) {
return Task.FromResult<ActionResult>(Ok());
}