1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

send notification IPNs on bitpay invoice

This commit is contained in:
Kyle Spearrin
2019-02-22 08:08:48 -05:00
parent 31097870a1
commit 4e99ae0dd6
5 changed files with 16 additions and 6 deletions

View File

@ -4,16 +4,20 @@ using Bit.Core.Models.Api;
using System.Threading.Tasks;
using Bit.Core.Utilities;
using Microsoft.AspNetCore.Authorization;
using Bit.Core;
namespace Bit.Api.Controllers
{
public class MiscController : Controller
{
private readonly BitPayClient _bitPayClient;
private readonly GlobalSettings _globalSettings;
public MiscController(BitPayClient bitPayClient)
public MiscController(BitPayClient bitPayClient,
GlobalSettings globalSettings)
{
_bitPayClient = bitPayClient;
_globalSettings = globalSettings;
}
[HttpGet("~/alive")]
@ -44,7 +48,7 @@ namespace Bit.Api.Controllers
[SelfHosted(NotSelfHostedOnly = true)]
public async Task<string> PostBitPayInvoice([FromBody]BitPayInvoiceRequestModel model)
{
var invoice = await _bitPayClient.CreateInvoiceAsync(model.ToBitpayClientInvoice());
var invoice = await _bitPayClient.CreateInvoiceAsync(model.ToBitpayClientInvoice(_globalSettings));
return invoice.Url;
}
}