From f225b5d46a4d4a4679409ea98329f65a2b6120b7 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sun, 10 Feb 2019 21:23:37 -0500 Subject: [PATCH] rename billing classes --- .../Models/Api/Response/BillingResponseModel.cs | 4 ++-- src/Core/Models/Business/BillingInfo.cs | 16 ++++++++-------- src/Core/Services/IPaymentService.cs | 2 +- .../Implementations/StripePaymentService.cs | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Core/Models/Api/Response/BillingResponseModel.cs b/src/Core/Models/Api/Response/BillingResponseModel.cs index efc2bda09..f53c0c8e9 100644 --- a/src/Core/Models/Api/Response/BillingResponseModel.cs +++ b/src/Core/Models/Api/Response/BillingResponseModel.cs @@ -115,7 +115,7 @@ namespace Bit.Core.Models.Api public class BillingInvoiceInfo { - public BillingInvoiceInfo(BillingInfo.BillingInvoice inv) + public BillingInvoiceInfo(BillingInfo.BillingInvoiceInfo inv) { Amount = inv.Amount; Date = inv.Date; @@ -127,7 +127,7 @@ namespace Bit.Core.Models.Api public class BillingInvoice : BillingInvoiceInfo { - public BillingInvoice(BillingInfo.BillingInvoice2 inv) + public BillingInvoice(BillingInfo.BillingInvoice inv) : base(inv) { Url = inv.Url; diff --git a/src/Core/Models/Business/BillingInfo.cs b/src/Core/Models/Business/BillingInfo.cs index ac4c6c067..ac8a4b6ab 100644 --- a/src/Core/Models/Business/BillingInfo.cs +++ b/src/Core/Models/Business/BillingInfo.cs @@ -12,9 +12,9 @@ namespace Bit.Core.Models.Business public decimal CreditAmount { get; set; } public BillingSource PaymentSource { get; set; } public BillingSubscription Subscription { get; set; } - public BillingInvoice UpcomingInvoice { get; set; } + public BillingInvoiceInfo UpcomingInvoice { get; set; } public IEnumerable Charges { get; set; } = new List(); - public IEnumerable Invoices { get; set; } = new List(); + public IEnumerable Invoices { get; set; } = new List(); public IEnumerable Transactions { get; set; } = new List(); public class BillingSource @@ -194,17 +194,17 @@ namespace Bit.Core.Models.Business } } - public class BillingInvoice + public class BillingInvoiceInfo { - public BillingInvoice() { } + public BillingInvoiceInfo() { } - public BillingInvoice(Invoice inv) + public BillingInvoiceInfo(Invoice inv) { Amount = inv.AmountDue / 100M; Date = inv.Date.Value; } - public BillingInvoice(Braintree.Subscription sub) + public BillingInvoiceInfo(Braintree.Subscription sub) { Amount = sub.NextBillAmount.GetValueOrDefault() + sub.Balance.GetValueOrDefault(); if(Amount < 0) @@ -309,9 +309,9 @@ namespace Bit.Core.Models.Business public string Details { get; set; } } - public class BillingInvoice2 : BillingInvoice + public class BillingInvoice : BillingInvoiceInfo { - public BillingInvoice2(Invoice inv) + public BillingInvoice(Invoice inv) { Url = inv.HostedInvoiceUrl; PdfUrl = inv.InvoicePdf; diff --git a/src/Core/Services/IPaymentService.cs b/src/Core/Services/IPaymentService.cs index 633d6fadd..cc220ce7c 100644 --- a/src/Core/Services/IPaymentService.cs +++ b/src/Core/Services/IPaymentService.cs @@ -17,7 +17,7 @@ namespace Bit.Core.Services Task ReinstateSubscriptionAsync(ISubscriber subscriber); Task UpdatePaymentMethodAsync(ISubscriber subscriber, PaymentMethodType paymentMethodType, string paymentToken); - Task GetUpcomingInvoiceAsync(ISubscriber subscriber); + Task GetUpcomingInvoiceAsync(ISubscriber subscriber); Task GetBillingAsync(ISubscriber subscriber); } } diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index 7ca6dc85b..9f5392aed 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -884,7 +884,7 @@ namespace Bit.Core.Services return createdCustomer; } - public async Task GetUpcomingInvoiceAsync(ISubscriber subscriber) + public async Task GetUpcomingInvoiceAsync(ISubscriber subscriber) { if(!string.IsNullOrWhiteSpace(subscriber.GatewaySubscriptionId)) { @@ -903,7 +903,7 @@ namespace Bit.Core.Services }); if(upcomingInvoice != null) { - return new BillingInfo.BillingInvoice(upcomingInvoice); + return new BillingInfo.BillingInvoiceInfo(upcomingInvoice); } } catch(StripeException) { } @@ -985,7 +985,7 @@ namespace Bit.Core.Services Limit = 20 }); billingInfo.Invoices = invoices?.Data?.OrderByDescending(i => i.Date) - .Select(i => new BillingInfo.BillingInvoice2(i)); + .Select(i => new BillingInfo.BillingInvoice(i)); } } @@ -1005,7 +1005,7 @@ namespace Bit.Core.Services new UpcomingInvoiceOptions { CustomerId = subscriber.GatewayCustomerId }); if(upcomingInvoice != null) { - billingInfo.UpcomingInvoice = new BillingInfo.BillingInvoice(upcomingInvoice); + billingInfo.UpcomingInvoice = new BillingInfo.BillingInvoiceInfo(upcomingInvoice); } } catch(StripeException) { }