mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Enable better error when invoice cannot be created on crowdfund (#575)
Closes #572
This commit is contained in:
committed by
Nicolas Dorier
parent
4f4d05b8cd
commit
f09f23e570
@@ -176,6 +176,8 @@ namespace BTCPayServer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
store.AdditionalClaims.Add(new Claim(Policies.CanCreateInvoice.Key, store.Id));
|
store.AdditionalClaims.Add(new Claim(Policies.CanCreateInvoice.Key, store.Id));
|
||||||
|
try
|
||||||
|
{
|
||||||
var invoice = await _InvoiceController.CreateInvoiceCore(new Invoice()
|
var invoice = await _InvoiceController.CreateInvoiceCore(new Invoice()
|
||||||
{
|
{
|
||||||
OrderId = $"{CrowdfundHubStreamer.CrowdfundInvoiceOrderIdPrefix}{appId}",
|
OrderId = $"{CrowdfundHubStreamer.CrowdfundInvoiceOrderIdPrefix}{appId}",
|
||||||
@@ -201,6 +203,12 @@ namespace BTCPayServer.Controllers
|
|||||||
return Ok(invoice.Data.Id);
|
return Ok(invoice.Data.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (BitpayHttpException e)
|
||||||
|
{
|
||||||
|
return BadRequest(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
|||||||
Reference in New Issue
Block a user