Enable better error when invoice cannot be created on crowdfund (#575)

Closes #572
This commit is contained in:
Andrew Camilleri
2019-01-29 10:32:44 +01:00
committed by Nicolas Dorier
parent 4f4d05b8cd
commit f09f23e570

View File

@@ -176,6 +176,8 @@ namespace BTCPayServer.Controllers
}
store.AdditionalClaims.Add(new Claim(Policies.CanCreateInvoice.Key, store.Id));
try
{
var invoice = await _InvoiceController.CreateInvoiceCore(new Invoice()
{
OrderId = $"{CrowdfundHubStreamer.CrowdfundInvoiceOrderIdPrefix}{appId}",
@@ -201,6 +203,12 @@ namespace BTCPayServer.Controllers
return Ok(invoice.Data.Id);
}
}
catch (BitpayHttpException e)
{
return BadRequest(e.Message);
}
}
[HttpPost]