|
|
|
|
@ -4,16 +4,20 @@ using Bit.Core.Models.Api;
@@ -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
@@ -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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|