mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
rename billing classes
This commit is contained in:
parent
f0fa1e00fb
commit
f225b5d46a
@ -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;
|
||||
|
@ -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<BillingCharge> Charges { get; set; } = new List<BillingCharge>();
|
||||
public IEnumerable<BillingInvoice2> Invoices { get; set; } = new List<BillingInvoice2>();
|
||||
public IEnumerable<BillingInvoice> Invoices { get; set; } = new List<BillingInvoice>();
|
||||
public IEnumerable<BillingTransaction> Transactions { get; set; } = new List<BillingTransaction>();
|
||||
|
||||
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;
|
||||
|
@ -17,7 +17,7 @@ namespace Bit.Core.Services
|
||||
Task ReinstateSubscriptionAsync(ISubscriber subscriber);
|
||||
Task<bool> UpdatePaymentMethodAsync(ISubscriber subscriber, PaymentMethodType paymentMethodType,
|
||||
string paymentToken);
|
||||
Task<BillingInfo.BillingInvoice> GetUpcomingInvoiceAsync(ISubscriber subscriber);
|
||||
Task<BillingInfo.BillingInvoiceInfo> GetUpcomingInvoiceAsync(ISubscriber subscriber);
|
||||
Task<BillingInfo> GetBillingAsync(ISubscriber subscriber);
|
||||
}
|
||||
}
|
||||
|
@ -884,7 +884,7 @@ namespace Bit.Core.Services
|
||||
return createdCustomer;
|
||||
}
|
||||
|
||||
public async Task<BillingInfo.BillingInvoice> GetUpcomingInvoiceAsync(ISubscriber subscriber)
|
||||
public async Task<BillingInfo.BillingInvoiceInfo> 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) { }
|
||||
|
Loading…
Reference in New Issue
Block a user