mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Keep compatible checkout page address
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<Version>1.0.0.10</Version>
|
<Version>1.0.0.11</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="Build\dockerfiles\**" />
|
<Compile Remove="Build\dockerfiles\**" />
|
||||||
|
|||||||
@@ -93,9 +93,15 @@ namespace BTCPayServer.Controllers
|
|||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("i/{invoiceId}")]
|
[Route("i/{invoiceId}")]
|
||||||
|
[Route("invoice")]
|
||||||
[AcceptMediaTypeConstraint("application/bitcoin-paymentrequest", false)]
|
[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);
|
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
|
||||||
if(invoice == null)
|
if(invoice == null)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
@@ -126,7 +132,7 @@ namespace BTCPayServer.Controllers
|
|||||||
|
|
||||||
var expiration = TimeSpan.FromSeconds((double)model.ExpirationSeconds);
|
var expiration = TimeSpan.FromSeconds((double)model.ExpirationSeconds);
|
||||||
model.TimeLeft = PrettyPrint(expiration);
|
model.TimeLeft = PrettyPrint(expiration);
|
||||||
return View(model);
|
return View(nameof(Checkout), model);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string PrettyPrint(TimeSpan expiration)
|
private string PrettyPrint(TimeSpan expiration)
|
||||||
|
|||||||
Reference in New Issue
Block a user