This commit is contained in:
nicolas.dorier 2018-01-04 22:21:47 +09:00
parent ab188ad54f
commit 44c925a4ba
2 changed files with 5 additions and 1 deletions

View File

@ -129,6 +129,8 @@ namespace BTCPayServer.Controllers
private async Task<PaymentModel> GetInvoiceModel(string invoiceId, string cryptoCode)
{
if (cryptoCode == null)
throw new ArgumentNullException(nameof(cryptoCode));
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
var network = _NetworkProvider.GetNetwork(cryptoCode);
if (invoice == null || network == null || !invoice.Support(network))
@ -183,6 +185,8 @@ namespace BTCPayServer.Controllers
[Route("i/{invoiceId}/status")]
public async Task<IActionResult> GetStatus(string invoiceId, string cryptoCode)
{
if (cryptoCode == null)
cryptoCode = "BTC";
var model = await GetInvoiceModel(invoiceId, cryptoCode);
if (model == null)
return NotFound();

View File

@ -256,7 +256,7 @@ namespace BTCPayServer.Services.Invoices
{
using (var tx = _Engine.GetTransaction())
{
tx.TextInsert("InvoiceSearch", Encoders.Base58.DecodeData(invoiceId), string.Join(" ", terms.Where(t => !String.IsNullOrWhiteSpace(t))));
tx.TextAppend("InvoiceSearch", Encoders.Base58.DecodeData(invoiceId), string.Join(" ", terms.Where(t => !String.IsNullOrWhiteSpace(t))));
tx.Commit();
}
});