mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-21 06:04:26 +01:00
Trust the payment method details for the payjoin enabled and make invoice logs consistent (#1450)
This commit is contained in:
@@ -164,16 +164,17 @@ namespace BTCPayServer.Payments.Bitcoin
|
||||
network.SupportPayJoin;
|
||||
if (onchainMethod.PayjoinEnabled)
|
||||
{
|
||||
var prefix = $"{supportedPaymentMethod.PaymentId.ToPrettyString()}:";
|
||||
var nodeSupport = _dashboard?.Get(network.CryptoCode)?.Status?.BitcoinStatus?.Capabilities
|
||||
?.CanSupportTransactionCheck is true;
|
||||
bool isHotwallet = supportedPaymentMethod.Source == "NBXplorer";
|
||||
onchainMethod.PayjoinEnabled &= isHotwallet && nodeSupport;
|
||||
if (!isHotwallet)
|
||||
logs.Write("Payjoin should have been enabled, but your store is not a hotwallet");
|
||||
logs.Write($"{prefix} Payjoin should have been enabled, but your store is not a hotwallet");
|
||||
if (!nodeSupport)
|
||||
logs.Write("Payjoin should have been enabled, but your version of NBXplorer or full node does not support it.");
|
||||
logs.Write($"{prefix} Payjoin should have been enabled, but your version of NBXplorer or full node does not support it.");
|
||||
if (onchainMethod.PayjoinEnabled)
|
||||
logs.Write("Payjoin is enabled for this invoice.");
|
||||
logs.Write($"{prefix} Payjoin is enabled for this invoice.");
|
||||
}
|
||||
|
||||
return onchainMethod;
|
||||
|
||||
@@ -470,9 +470,9 @@ namespace BTCPayServer.Services.Invoices
|
||||
dto.MinerFees.TryAdd(cryptoInfo.CryptoCode, minerInfo);
|
||||
var bip21 = ((BTCPayNetwork)info.Network).GenerateBIP21(cryptoInfo.Address, cryptoInfo.Due);
|
||||
|
||||
if (((details as BitcoinLikeOnChainPaymentMethod)?.PayjoinEnabled??false) && cryptoInfo.CryptoCode.Equals("BTC", StringComparison.InvariantCultureIgnoreCase))
|
||||
if ((details as BitcoinLikeOnChainPaymentMethod)?.PayjoinEnabled is true)
|
||||
{
|
||||
bip21 += $"&bpu={ServerUrl.WithTrailingSlash()}{cryptoCode}/bpu";
|
||||
bip21 += $"&{PayjoinClient.BIP21EndpointKey}={ServerUrl.WithTrailingSlash()}{cryptoCode}/{PayjoinClient.BIP21EndpointKey}";
|
||||
}
|
||||
cryptoInfo.PaymentUrls = new NBitpayClient.InvoicePaymentUrls()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user