mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-03 17:36:59 +01:00
Remove unused ExpireInvoiceResponse type
This commit is contained in:
parent
6c688b9684
commit
1037fe0b14
2 changed files with 2 additions and 22 deletions
|
@ -1,10 +0,0 @@
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace BTCPayServer.Client.Models
|
|
||||||
{
|
|
||||||
public class ExpireInvoiceResponse
|
|
||||||
{
|
|
||||||
public String SuccessMessage { get; set; }
|
|
||||||
public String ErrorMessage { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -96,25 +96,15 @@ namespace BTCPayServer.Controllers
|
||||||
[CheatModeRoute]
|
[CheatModeRoute]
|
||||||
public async Task<IActionResult> TestExpireNow(string invoiceId, [FromServices] Cheater cheater)
|
public async Task<IActionResult> TestExpireNow(string invoiceId, [FromServices] Cheater cheater)
|
||||||
{
|
{
|
||||||
var invoice = await _InvoiceRepository.GetInvoice(invoiceId);
|
|
||||||
ExpireInvoiceResponse expireInvoiceResponse = new ExpireInvoiceResponse();
|
|
||||||
|
|
||||||
// TODO complete this
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await cheater.UpdateInvoiceExpiry(invoiceId, DateTimeOffset.Now);
|
await cheater.UpdateInvoiceExpiry(invoiceId, DateTimeOffset.Now);
|
||||||
expireInvoiceResponse.SuccessMessage = "Invoice is now expired.";
|
return Ok(new { SuccessMessage = "Invoice is now expired." });
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
expireInvoiceResponse.ErrorMessage = e.Message;
|
return BadRequest(new { ErrorMessage = e.Message });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expireInvoiceResponse.ErrorMessage == null)
|
|
||||||
{
|
|
||||||
return Ok(expireInvoiceResponse);
|
|
||||||
}
|
|
||||||
return BadRequest(expireInvoiceResponse);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue