Keep compatible checkout page address

This commit is contained in:
nicolas.dorier 2017-10-13 16:07:57 +09:00
parent c98f0ba55b
commit 033432d6fb
2 changed files with 9 additions and 3 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<Version>1.0.0.10</Version>
<Version>1.0.0.11</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Build\dockerfiles\**" />

View File

@ -93,9 +93,15 @@ namespace BTCPayServer.Controllers
[HttpGet]
[Route("i/{invoiceId}")]
[Route("invoice")]
[AcceptMediaTypeConstraint("application/bitcoin-paymentrequest", false)]
public async Task<IActionResult> Checkout(string invoiceId)
public async Task<IActionResult> Checkout(string invoiceId, string id = null)
{
//Keep compatibility with Bitpay
invoiceId = invoiceId ?? id;
id = invoiceId;
////
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
if(invoice == null)
return NotFound();
@ -126,7 +132,7 @@ namespace BTCPayServer.Controllers
var expiration = TimeSpan.FromSeconds((double)model.ExpirationSeconds);
model.TimeLeft = PrettyPrint(expiration);
return View(model);
return View(nameof(Checkout), model);
}
private string PrettyPrint(TimeSpan expiration)