mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Remove "enabled" option from address preview endpoint
This commit is contained in:
committed by
Andrew Camilleri
parent
0d08bd3ad1
commit
d39ec97b9a
@@ -2,30 +2,43 @@ using NBitcoin;
|
|||||||
|
|
||||||
namespace BTCPayServer.Client.Models
|
namespace BTCPayServer.Client.Models
|
||||||
{
|
{
|
||||||
public class OnChainPaymentMethodData : OnChainPaymentMethodBaseData
|
public class OnChainPaymentMethodDataPreview : OnChainPaymentMethodBaseData
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Whether the payment method is enabled
|
|
||||||
/// </summary>
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Crypto code of the payment method
|
/// Crypto code of the payment method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CryptoCode { get; set; }
|
public string CryptoCode { get; set; }
|
||||||
|
|
||||||
public OnChainPaymentMethodData()
|
public OnChainPaymentMethodDataPreview()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OnChainPaymentMethodData(string cryptoCode, string derivationScheme, bool enabled, string label, RootedKeyPath accountKeyPath)
|
public OnChainPaymentMethodDataPreview(string cryptoCode, string derivationScheme, string label, RootedKeyPath accountKeyPath)
|
||||||
{
|
{
|
||||||
Enabled = enabled;
|
|
||||||
Label = label;
|
Label = label;
|
||||||
AccountKeyPath = accountKeyPath;
|
AccountKeyPath = accountKeyPath;
|
||||||
CryptoCode = cryptoCode;
|
CryptoCode = cryptoCode;
|
||||||
DerivationScheme = derivationScheme;
|
DerivationScheme = derivationScheme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class OnChainPaymentMethodData : OnChainPaymentMethodDataPreview
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the payment method is enabled
|
||||||
|
/// </summary>
|
||||||
|
public bool Enabled { get; set; }
|
||||||
|
|
||||||
|
public OnChainPaymentMethodData()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public OnChainPaymentMethodData(string cryptoCode, string derivationScheme, bool enabled, string label, RootedKeyPath accountKeyPath) :
|
||||||
|
base(cryptoCode, derivationScheme, label, accountKeyPath)
|
||||||
|
{
|
||||||
|
Enabled = enabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ namespace BTCPayServer.Controllers.GreenField
|
|||||||
public IActionResult GetProposedOnChainPaymentMethodPreview(
|
public IActionResult GetProposedOnChainPaymentMethodPreview(
|
||||||
string storeId,
|
string storeId,
|
||||||
string cryptoCode,
|
string cryptoCode,
|
||||||
[FromBody] OnChainPaymentMethodData paymentMethodData,
|
[FromBody] OnChainPaymentMethodDataPreview paymentMethodData,
|
||||||
int offset = 0, int amount = 10)
|
int offset = 0, int amount = 10)
|
||||||
{
|
{
|
||||||
if (!GetCryptoCodeWallet(cryptoCode, out var network, out BTCPayWallet _))
|
if (!GetCryptoCodeWallet(cryptoCode, out var network, out BTCPayWallet _))
|
||||||
|
|||||||
@@ -361,7 +361,7 @@
|
|||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/schemas/OnChainPaymentMethodData"
|
"$ref": "#/components/schemas/OnChainPaymentMethodDataPreview"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -445,13 +445,21 @@
|
|||||||
"OnChainPaymentMethodData": {
|
"OnChainPaymentMethodData": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
|
"$ref": "#/components/schemas/OnChainPaymentMethodDataPreview"
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Whether the payment method is enabled"
|
"description": "Whether the payment method is enabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
"OnChainPaymentMethodDataPreview": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
"cryptoCode": {
|
"cryptoCode": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Crypto code of the payment method"
|
"description": "Crypto code of the payment method"
|
||||||
|
|||||||
Reference in New Issue
Block a user