Rename IPaymentMethodFactory to ISupportedPaymentMethod

This commit is contained in:
nicolas.dorier 2018-02-20 10:44:39 +09:00
parent 2e45c8b190
commit 3f07010de8
5 changed files with 9 additions and 9 deletions

View file

@ -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;

View file

@ -9,7 +9,7 @@ using NBXplorer.DerivationStrategy;
namespace BTCPayServer
{
public class DerivationStrategy : IPaymentMethodFactory
public class DerivationStrategy : ISupportedPaymentMethod
{
private DerivationStrategyBase _DerivationStrategy;
private BTCPayNetwork _Network;

View file

@ -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<DerivationStrategy>()
.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<DerivationStrategy>())
{
if (derivationStrategy.Network.CryptoCode == cryptoCode)

View file

@ -6,7 +6,7 @@ using BTCPayServer.Services.Invoices;
namespace BTCPayServer.Payments
{
public interface IPaymentMethodFactory
public interface ISupportedPaymentMethod
{
PaymentMethodId PaymentId { get; }
}

View file

@ -169,7 +169,7 @@ namespace BTCPayServer.Services.Invoices
set;
}
public IEnumerable<IPaymentMethodFactory> GetPaymentMethodFactories(BTCPayNetworkProvider networks)
public IEnumerable<ISupportedPaymentMethod> 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<IPaymentMethodFactory> derivationStrategies)
internal void SetSupportedPaymentMethods(IEnumerable<ISupportedPaymentMethod> 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)