I would like to use for our project the Microsoft.AspNet.WebHooks.Receivers.Stripe library. However my WebApi is ApiVersion (Microsoft.AspNet.WebApi.Versioning) enabled. That somehow interferes with the WebHooks default Url which is:
https://<host>/api/webhooks/incoming/<receiver>
I am using the sample StripeWebHookHandler from the AspNet samples. I tried putting the ApiVersion on the WebHookHandler like this with no success:
[ApiVersion("1")]
[RoutePrefix("api/v{version:apiVersion}/webhooks/incoming/stripe")]
public class StripeWebHookHandler : WebHookHandler
I am guessing that this must be a common problem however I haven't found any solution to this, is there anyway:
1) to have the webhook URL versioned using the provided StripeWebHookHandler.
2) to disable the versioning for this particular URL (also tried the [ApiVersionNeutral] attribute).
I actually ended up creating my own Web API controller that handles the Stripe WebHook. If anyone is interested they can reuse this piece of code that was adapted from Stripe documentation to suit our Web API controller.
You need to get the official .net Stripe nuget package to be able to use this code.