1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 09:32:48 -05:00

stripe webhook key from billing settings

This commit is contained in:
Kyle Spearrin
2017-04-26 14:29:25 -04:00
parent 91af4e12c7
commit 398a4d8e46
4 changed files with 39 additions and 3 deletions

View File

@ -1,14 +1,27 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
namespace Bit.Billing.Controllers
{
[Route("stripe")]
public class StripeController : Controller
{
[HttpPost("webhook")]
public void PostWebhook([FromBody]dynamic body, [FromQuery] string key)
{
private readonly BillingSettings _billingSettings;
public StripeController(IOptions<BillingSettings> billingSettings)
{
_billingSettings = billingSettings?.Value;
}
[HttpPost("webhook")]
public IActionResult PostWebhook([FromBody]dynamic body, [FromQuery] string key)
{
if(key != _billingSettings.StripeWebhookKey)
{
return new BadRequestResult();
}
return new OkResult();
}
}
}