Greenfield: Fix payment method update regression (#5932)

* Greenfield: Fix payment method update regression

Do not exclude if `enabled` is `true`. Got introduced in #5809.

* Fix PaymentMethodId Swagger docs
This commit is contained in:
d11n 2024-04-16 04:32:52 +02:00 committed by GitHub
parent 36cfc3648f
commit 76719cdc4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 7 deletions

View file

@ -115,7 +115,7 @@ namespace BTCPayServer.Controllers.Greenfield
if (request?.Enabled is { } enabled)
{
var storeBlob = Store.GetStoreBlob();
storeBlob.SetExcluded(paymentMethodId, enabled);
storeBlob.SetExcluded(paymentMethodId, !enabled);
Store.SetStoreBlob(storeBlob);
}
await _storeRepository.UpdateStore(Store);

View file

@ -108,7 +108,8 @@
},
"PaymentMethodId": {
"type": "string",
"description": "Payment method IDs are a combination of crypto code and payment type. Available payment method IDs for Bitcoin are: \n- `\"BTC-OnChain\"` (with the equivalent of `\"BTC\"`) \n-`\"BTC-LightningLike\"`: Any supported LN-based payment method (Lightning or LNURL) \n- `\"BTC-LightningNetwork\"`: Lightning \n- `\"BTC-LNURLPAY\"`: LNURL \n \nNote: Separator can be either `-` or `_`."
"description": "Payment method IDs are a combination of crypto code and payment type. Available payment method IDs for Bitcoin are: \n- `\"BTC-CHAIN\"`: Onchain \n-`\"BTC-LN\"`: Lightning \n- `\"BTC-LNURL\"`: LNURL",
"example": "BTC-CHAIN"
}
},
"securitySchemes": {

View file

@ -345,11 +345,6 @@
}
}
},
"PaymentMethodId": {
"type": "string",
"description": "The payment method id (`BTC-CHAIN`, `BTC-LN`, `BTC-LNURL`)",
"example": "BTC-CHAIN"
},
"GenericPaymentMethodData": {
"type": "object",
"additionalProperties": false,