mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
[PM-3892] Implement dollar threshold for all subscriptions (#3283)
* Initial commit * Fix the failing text * Fix the unpaid invoice issue * fix the unpaid invoice issue * Changes for the threshold amount * remove the billing threshold * Add some comments to the old method * Fixing issues on secret manager test * import missing package * Resolve pr comments * Refactor PreviewUpcomingInvoiceAndPayAsync method * Resolve some pr comments * Resolving the comment around constant * Resolve pr comment * Add new class * Resolve pr comments * Change the prorateThreshold from 5 to 500 dollars * Fix the failing test * Fix the server returns a 500 error with the banner
This commit is contained in:
7
src/Core/Models/Business/InvoicePreviewResult.cs
Normal file
7
src/Core/Models/Business/InvoicePreviewResult.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Bit.Core.Models.Business;
|
||||
|
||||
public class InvoicePreviewResult
|
||||
{
|
||||
public bool IsInvoicedNow { get; set; }
|
||||
public string PaymentIntentClientSecret { get; set; }
|
||||
}
|
9
src/Core/Models/Business/PendingInoviceItems.cs
Normal file
9
src/Core/Models/Business/PendingInoviceItems.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using Stripe;
|
||||
|
||||
namespace Bit.Core.Models.Business;
|
||||
|
||||
public class PendingInoviceItems
|
||||
{
|
||||
public IEnumerable<InvoiceItem> PendingInvoiceItems { get; set; }
|
||||
public IDictionary<string, InvoiceItem> PendingInvoiceItemsDict { get; set; }
|
||||
}
|
@ -44,7 +44,7 @@ public class SecretsManagerSubscribeUpdate : SubscriptionUpdate
|
||||
{
|
||||
updatedItems.Add(new SubscriptionItemOptions
|
||||
{
|
||||
Price = _plan.SecretsManager.StripeSeatPlanId,
|
||||
Plan = _plan.SecretsManager.StripeSeatPlanId,
|
||||
Quantity = _additionalSeats
|
||||
});
|
||||
}
|
||||
@ -53,7 +53,7 @@ public class SecretsManagerSubscribeUpdate : SubscriptionUpdate
|
||||
{
|
||||
updatedItems.Add(new SubscriptionItemOptions
|
||||
{
|
||||
Price = _plan.SecretsManager.StripeServiceAccountPlanId,
|
||||
Plan = _plan.SecretsManager.StripeServiceAccountPlanId,
|
||||
Quantity = _additionalServiceAccounts
|
||||
});
|
||||
}
|
||||
@ -63,14 +63,14 @@ public class SecretsManagerSubscribeUpdate : SubscriptionUpdate
|
||||
{
|
||||
updatedItems.Add(new SubscriptionItemOptions
|
||||
{
|
||||
Price = _plan.SecretsManager.StripeSeatPlanId,
|
||||
Plan = _plan.SecretsManager.StripeSeatPlanId,
|
||||
Quantity = _previousSeats,
|
||||
Deleted = _previousSeats == 0 ? true : (bool?)null,
|
||||
});
|
||||
|
||||
updatedItems.Add(new SubscriptionItemOptions
|
||||
{
|
||||
Price = _plan.SecretsManager.StripeServiceAccountPlanId,
|
||||
Plan = _plan.SecretsManager.StripeServiceAccountPlanId,
|
||||
Quantity = _previousServiceAccounts,
|
||||
Deleted = _previousServiceAccounts == 0 ? true : (bool?)null,
|
||||
});
|
||||
|
Reference in New Issue
Block a user