title: How do I initialize a webhook receiver in ASP.Net MVC
body: <p>I'm following this guide <a href="https://docs.microsoft.com/en-us/aspnet/webhooks/receiving/receivers" rel="nofollow noreferrer">here</a> for installing and using webhooks in ASP.Net MVC, but it looks like this guide is for a wep api type project. I'm using a MVC type project and there is no Register method, unlike a API project. In MVC we have a RegisterRoutes method. So how do I register my webhooks in MVC?</p>
  
  <p>an API project that uses Register and config, my ASP.Net MVC site doesn't have this.</p>
  
  <p><a href="https://i.stack.imgur.com/BU1dY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BU1dY.png" alt="enter image description here"></a></p>
  
  <p>MVC uses RegisterRoutes</p>
  
  <p><a href="https://i.stack.imgur.com/LCFC5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LCFC5.png" alt="enter image description here"></a></p>
  
  <p><strong><em>UPdate</em></strong>
  Here I added a web api controller and the code I posted below is whats in the web api controller. I included the nuget packages for webhooks, the registration in global.asax.cs and in the register method. But I'm still having problems reaching the code 'ExecuteAsync' no breakpoints are being hit</p>
  
  <pre><code>public class StripeWebHookHandler : WebHookHandler
  {
      // ngrok http -host-header="localhost:[port]" [port]
      // http(s)://&lt;yourhost&gt;/api/webhooks/incoming/stripe/   strip receiver
  
      public StripeWebHookHandler()
      {
          this.Receiver = StripeWebHookReceiver.ReceiverName;
      }
  
      public override Task ExecuteAsync(string generator, WebHookHandlerContext context)
      {
          // For more information about Stripe WebHook payloads, please see 
          // 'https://stripe.com/docs/webhooks'
          StripeEvent entry = context.GetDataOrDefault&lt;StripeEvent&gt;();
  
          // We can trace to see what is going on.
          Trace.WriteLine(entry.ToString());
  
          // Switch over the event types if you want to
          switch (entry.EventType)
          {
              default:
                  // Information can be returned in a plain text response
                  context.Response = context.Request.CreateResponse();
                  context.Response.Content = new StringContent(string.Format("Hello {0} event!", entry.EventType));
                  break;
          }
  
          return Task.FromResult(true);
      }
  }
  </code></pre>