From 3f07010de82cd7264d73fca339c7724fb4c56716 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 20 Feb 2018 10:44:39 +0900 Subject: [PATCH] Rename IPaymentMethodFactory to ISupportedPaymentMethod --- BTCPayServer/Controllers/InvoiceController.cs | 2 +- BTCPayServer/DerivationStrategy.cs | 2 +- BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs | 4 ++-- ...PaymentMethodFactory.cs => ISupportedPaymentMethod.cs} | 2 +- BTCPayServer/Services/Invoices/InvoiceEntity.cs | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) rename BTCPayServer/Payments/{IPaymentMethodFactory.cs => ISupportedPaymentMethod.cs} (83%) diff --git a/BTCPayServer/Controllers/InvoiceController.cs b/BTCPayServer/Controllers/InvoiceController.cs index cf7d88761..3f653c684 100644 --- a/BTCPayServer/Controllers/InvoiceController.cs +++ b/BTCPayServer/Controllers/InvoiceController.cs @@ -88,7 +88,7 @@ namespace BTCPayServer.Controllers { InvoiceTime = DateTimeOffset.UtcNow }; - entity.SetPaymentMethodFactories(derivationStrategies); + entity.SetSupportedPaymentMethods(derivationStrategies); var storeBlob = store.GetStoreBlob(); Uri notificationUri = Uri.IsWellFormedUriString(invoice.NotificationURL, UriKind.Absolute) ? new Uri(invoice.NotificationURL, UriKind.Absolute) : null; diff --git a/BTCPayServer/DerivationStrategy.cs b/BTCPayServer/DerivationStrategy.cs index 753430f51..ae2cbd963 100644 --- a/BTCPayServer/DerivationStrategy.cs +++ b/BTCPayServer/DerivationStrategy.cs @@ -9,7 +9,7 @@ using NBXplorer.DerivationStrategy; namespace BTCPayServer { - public class DerivationStrategy : IPaymentMethodFactory + public class DerivationStrategy : ISupportedPaymentMethod { private DerivationStrategyBase _DerivationStrategy; private BTCPayNetwork _Network; diff --git a/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs b/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs index 4b96a72fb..956cf974f 100644 --- a/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs +++ b/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs @@ -351,7 +351,7 @@ namespace BTCPayServer.Payments.Bitcoin private DerivationStrategyBase GetDerivationStrategy(InvoiceEntity invoice, BTCPayNetwork network) { - return invoice.GetPaymentMethodFactories(_ExplorerClients.NetworkProviders) + return invoice.GetSupportedPaymentMethod(_ExplorerClients.NetworkProviders) .OfType() .Where(d => d.Network.CryptoCode == network.CryptoCode) .Select(d => d.DerivationStrategyBase) @@ -396,7 +396,7 @@ namespace BTCPayServer.Payments.Bitcoin private DerivationStrategyBase GetStrategy(string cryptoCode, InvoiceEntity invoice) { - foreach (var derivationStrategy in invoice.GetPaymentMethodFactories(_ExplorerClients.NetworkProviders) + foreach (var derivationStrategy in invoice.GetSupportedPaymentMethod(_ExplorerClients.NetworkProviders) .OfType()) { if (derivationStrategy.Network.CryptoCode == cryptoCode) diff --git a/BTCPayServer/Payments/IPaymentMethodFactory.cs b/BTCPayServer/Payments/ISupportedPaymentMethod.cs similarity index 83% rename from BTCPayServer/Payments/IPaymentMethodFactory.cs rename to BTCPayServer/Payments/ISupportedPaymentMethod.cs index 83c9ebb9e..20e1ffa66 100644 --- a/BTCPayServer/Payments/IPaymentMethodFactory.cs +++ b/BTCPayServer/Payments/ISupportedPaymentMethod.cs @@ -6,7 +6,7 @@ using BTCPayServer.Services.Invoices; namespace BTCPayServer.Payments { - public interface IPaymentMethodFactory + public interface ISupportedPaymentMethod { PaymentMethodId PaymentId { get; } } diff --git a/BTCPayServer/Services/Invoices/InvoiceEntity.cs b/BTCPayServer/Services/Invoices/InvoiceEntity.cs index 0e29fff8f..18095a3dc 100644 --- a/BTCPayServer/Services/Invoices/InvoiceEntity.cs +++ b/BTCPayServer/Services/Invoices/InvoiceEntity.cs @@ -169,7 +169,7 @@ namespace BTCPayServer.Services.Invoices set; } - public IEnumerable GetPaymentMethodFactories(BTCPayNetworkProvider networks) + public IEnumerable GetSupportedPaymentMethod(BTCPayNetworkProvider networks) { #pragma warning disable CS0618 bool btcReturned = false; @@ -199,7 +199,7 @@ namespace BTCPayServer.Services.Invoices #pragma warning restore CS0618 } - internal void SetPaymentMethodFactories(IEnumerable derivationStrategies) + internal void SetSupportedPaymentMethods(IEnumerable derivationStrategies) { JObject obj = new JObject(); foreach (var strat in derivationStrategies) @@ -214,7 +214,7 @@ namespace BTCPayServer.Services.Invoices } - private IPaymentMethodFactory Deserialize(PaymentMethodId paymentMethodId, JToken value, BTCPayNetwork network) + private ISupportedPaymentMethod Deserialize(PaymentMethodId paymentMethodId, JToken value, BTCPayNetwork network) { // Legacy if (paymentMethodId.PaymentType == PaymentTypes.BTCLike) @@ -229,7 +229,7 @@ namespace BTCPayServer.Services.Invoices throw new NotSupportedException(); } - JToken Serialize(IPaymentMethodFactory factory) + JToken Serialize(ISupportedPaymentMethod factory) { // Legacy if(factory.PaymentId.PaymentType == PaymentTypes.BTCLike)