mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Prevent payment request to be created when a wallet is not set up (#5620)
* Prevent payment request to be created when a wallet is not set up * Created an extension method for store wallet checks * fix for invoice and payment request selenium test * refactoring payment request controller * removing unused variable * Unify behaviour across controllers --------- Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
committed by
GitHub
parent
e90414bded
commit
f7542c988d
@@ -60,6 +60,14 @@ namespace BTCPayServer.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool AnyPaymentMethodAvailable(this StoreData storeData, BTCPayNetworkProvider networkProvider)
|
||||
{
|
||||
var storeBlob = GetStoreBlob(storeData);
|
||||
var excludeFilter = storeBlob.GetExcludedPaymentMethods();
|
||||
|
||||
return GetSupportedPaymentMethods(storeData, networkProvider).Where(s => !excludeFilter.Match(s.PaymentId)).Any();
|
||||
}
|
||||
|
||||
public static bool SetStoreBlob(this StoreData storeData, StoreBlob storeBlob)
|
||||
{
|
||||
var original = new Serializer(null).ToString(storeData.GetStoreBlob());
|
||||
|
||||
Reference in New Issue
Block a user