Fix: Disable LNURL if Lightning gets disabled.

This commit is contained in:
Kukks
2021-11-08 08:51:21 +01:00
parent 59cf53e083
commit befa436087

View File

@@ -260,6 +260,10 @@ namespace BTCPayServer.Controllers
var paymentMethodId = new PaymentMethodId(network.CryptoCode, PaymentTypes.LightningLike);
var storeBlob = store.GetStoreBlob();
storeBlob.SetExcluded(paymentMethodId, !enabled);
if (!enabled)
{
storeBlob.SetExcluded(new PaymentMethodId(network.CryptoCode, PaymentTypes.LNURLPay), true);
}
store.SetStoreBlob(storeBlob);
await _Repo.UpdateStore(store);
TempData[WellKnownTempData.SuccessMessage] = $"{network.CryptoCode} Lightning payments are now {(enabled ? "enabled" : "disabled")} for this store.";