mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -05:00
Added percent off to discount, removed discount from user sub (#3326)
This commit is contained in:
@ -4,7 +4,7 @@ namespace Bit.Core.Models.Business;
|
||||
|
||||
public class SubscriptionInfo
|
||||
{
|
||||
public BillingCustomerDiscount Discount { get; set; }
|
||||
public BillingCustomerDiscount CustomerDiscount { get; set; }
|
||||
public BillingSubscription Subscription { get; set; }
|
||||
public BillingUpcomingInvoice UpcomingInvoice { get; set; }
|
||||
public bool UsingInAppPurchase { get; set; }
|
||||
@ -17,10 +17,12 @@ public class SubscriptionInfo
|
||||
{
|
||||
Id = discount.Id;
|
||||
Active = discount.Start != null && discount.End == null;
|
||||
PercentOff = discount.Coupon?.PercentOff;
|
||||
}
|
||||
|
||||
public string Id { get; }
|
||||
public bool Active { get; }
|
||||
public decimal? PercentOff { get; }
|
||||
}
|
||||
|
||||
public class BillingSubscription
|
||||
|
@ -1568,7 +1568,7 @@ public class StripePaymentService : IPaymentService
|
||||
|
||||
if (customer.Discount != null)
|
||||
{
|
||||
subscriptionInfo.Discount = new SubscriptionInfo.BillingCustomerDiscount(customer.Discount);
|
||||
subscriptionInfo.CustomerDiscount = new SubscriptionInfo.BillingCustomerDiscount(customer.Discount);
|
||||
}
|
||||
|
||||
if (subscriber.IsUser())
|
||||
|
Reference in New Issue
Block a user