mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-24 01:14:20 +01:00
Add better error message if v1 routes are used.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using BTCPayServer.Abstractions.Constants;
|
||||
using BTCPayServer.Abstractions.Extensions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BTCPayServer.Controllers.GreenField
|
||||
{
|
||||
[ApiController]
|
||||
[EnableCors(CorsPolicies.All)]
|
||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
|
||||
public class GreenfieldObsoleteController : ControllerBase
|
||||
{
|
||||
[HttpGet("~/api/v1/stores/{storeId}/payment-methods/LNURL")]
|
||||
public IActionResult Obsolete1(string storeId)
|
||||
{
|
||||
return Obsolete();
|
||||
}
|
||||
[HttpGet("~/api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}")]
|
||||
[HttpDelete("~/api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}")]
|
||||
[HttpPut("~/api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}")]
|
||||
public IActionResult Obsolete2(string storeId, string cryptoCode)
|
||||
{
|
||||
return Obsolete();
|
||||
}
|
||||
[HttpGet("~/api/v1/stores/{storeId}/payment-methods/LightningNetwork")]
|
||||
public IActionResult Obsolete3(string storeId)
|
||||
{
|
||||
return Obsolete();
|
||||
}
|
||||
[HttpGet("~/api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}")]
|
||||
[HttpDelete("~/api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}")]
|
||||
[HttpPut("~/api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}")]
|
||||
public IActionResult Obsolete4(string storeId, string cryptoCode)
|
||||
{
|
||||
return Obsolete();
|
||||
}
|
||||
private IActionResult Obsolete()
|
||||
{
|
||||
return this.CreateAPIError(410, "unsupported-in-v2", "This route isn't supported by BTCPay Server 2.0 and newer. Please update your integration.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user