using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using PlotLine.Services; namespace PlotLine.Controllers; [AllowAnonymous] [ApiController] [Route("api/stripe/webhook")] public sealed class StripeWebhookController(IStripeBillingService stripeBilling) : ControllerBase { [HttpPost] public async Task Post() { var json = await new StreamReader(Request.Body).ReadToEndAsync(); var signature = Request.Headers["Stripe-Signature"].ToString(); var result = await stripeBilling.HandleWebhookAsync(json, signature); return StatusCode(result.StatusCode, result.Message); } }