1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 13:38:13 -05:00
This commit is contained in:
Jonas Hendrickx 2025-04-02 12:18:15 +02:00
parent a87502d466
commit aed58506e7
No known key found for this signature in database
GPG Key ID: C4B27F601CE4317D

View File

@ -3,27 +3,33 @@ using Stripe;
namespace Bit.Core.Test.Billing.Stubs; namespace Bit.Core.Test.Billing.Stubs;
/// <param name="IsAutomaticTaxEnabled"> /// <param name="isAutomaticTaxEnabled">
/// Whether the subscription options will have automatic tax enabled or not. /// Whether the subscription options will have automatic tax enabled or not.
/// </param> /// </param>
public class FakeAutomaticTaxStrategy( public class FakeAutomaticTaxStrategy(
bool IsAutomaticTaxEnabled) : IAutomaticTaxStrategy bool isAutomaticTaxEnabled) : IAutomaticTaxStrategy
{ {
public SubscriptionUpdateOptions? GetUpdateOptions(Subscription subscription) public SubscriptionUpdateOptions? GetUpdateOptions(Subscription subscription)
{ {
return new SubscriptionUpdateOptions return new SubscriptionUpdateOptions
{ {
AutomaticTax = new SubscriptionAutomaticTaxOptions { Enabled = IsAutomaticTaxEnabled } AutomaticTax = new SubscriptionAutomaticTaxOptions { Enabled = isAutomaticTaxEnabled }
}; };
} }
public void SetCreateOptions(SubscriptionCreateOptions options, Customer customer) public void SetCreateOptions(SubscriptionCreateOptions options, Customer customer)
{ {
options.AutomaticTax = new SubscriptionAutomaticTaxOptions { Enabled = IsAutomaticTaxEnabled }; options.AutomaticTax = new SubscriptionAutomaticTaxOptions { Enabled = isAutomaticTaxEnabled };
} }
public void SetUpdateOptions(SubscriptionUpdateOptions options, Subscription subscription) public void SetUpdateOptions(SubscriptionUpdateOptions options, Subscription subscription)
{ {
options.AutomaticTax = new SubscriptionAutomaticTaxOptions { Enabled = IsAutomaticTaxEnabled }; options.AutomaticTax = new SubscriptionAutomaticTaxOptions { Enabled = isAutomaticTaxEnabled };
}
public void SetInvoiceCreatePreviewOptions(InvoiceCreatePreviewOptions options)
{
options.AutomaticTax = new InvoiceAutomaticTaxOptions { Enabled = isAutomaticTaxEnabled };
} }
} }