diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index 383ec1b0dd..c78c365c4f 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -734,7 +734,7 @@ namespace Bit.Core.Services var storageItem = sub.Items?.FirstOrDefault(i => i.Plan.Id == storagePlanId); // Retain original collection method var collectionMethod = sub.CollectionMethod; - + var subResponse = await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions { Items = new List @@ -942,7 +942,7 @@ namespace Bit.Core.Services { throw new GatewayException("Failed to charge PayPal customer."); } - + braintreeTransaction = transactionResult.Target; invoice = await invoiceService.UpdateAsync(invoice.Id, new InvoiceUpdateOptions { @@ -1557,39 +1557,39 @@ namespace Bit.Core.Services public async Task GetTaxInfoAsync(ISubscriber subscriber) { - if (subscriber != null && !string.IsNullOrWhiteSpace(subscriber.GatewayCustomerId)) + if (subscriber == null || string.IsNullOrWhiteSpace(subscriber.GatewayCustomerId)) { - var customerService = new CustomerService(); - var customer = await customerService.GetAsync(subscriber.GatewayCustomerId); - - if (customer == null) - { - return null; - } - - var address = customer.Address; - var taxId = customer.TaxIds?.FirstOrDefault(); - - // Line1 is required, so if missing we're using the subscriber name - // see: https://stripe.com/docs/api/customers/create#create_customer-address-line1 - if (address != null && string.IsNullOrWhiteSpace(address.Line1)) - { - address.Line1 = null; - } - - return new TaxInfo - { - TaxIdNumber = taxId?.Value, - BillingAddressLine1 = address?.Line1, - BillingAddressLine2 = address?.Line2, - BillingAddressCity = address?.City, - BillingAddressState = address?.State, - BillingAddressPostalCode = address?.PostalCode, - BillingAddressCountry = address?.Country, - }; + return null; } - return null; + var customerService = new CustomerService(); + var customer = await customerService.GetAsync(subscriber.GatewayCustomerId); + + if (customer == null) + { + return null; + } + + var address = customer.Address; + var taxId = customer.TaxIds?.FirstOrDefault(); + + // Line1 is required, so if missing we're using the subscriber name + // see: https://stripe.com/docs/api/customers/create#create_customer-address-line1 + if (address != null && string.IsNullOrWhiteSpace(address.Line1)) + { + address.Line1 = null; + } + + return new TaxInfo + { + TaxIdNumber = taxId?.Value, + BillingAddressLine1 = address?.Line1, + BillingAddressLine2 = address?.Line2, + BillingAddressCity = address?.City, + BillingAddressState = address?.State, + BillingAddressPostalCode = address?.PostalCode, + BillingAddressCountry = address?.Country, + }; } public async Task SaveTaxInfoAsync(ISubscriber subscriber, TaxInfo taxInfo) diff --git a/src/Core/Utilities/StaticStore.cs b/src/Core/Utilities/StaticStore.cs index 0045356328..cf694eea5c 100644 --- a/src/Core/Utilities/StaticStore.cs +++ b/src/Core/Utilities/StaticStore.cs @@ -123,9 +123,9 @@ namespace Bit.Core.Utilities IsAnnual = true, NameLocalizationKey = "planNameFamilies", DescriptionLocalizationKey = "planDescFamilies", - BaseSeats = 6, + BaseSeats = 5, BaseStorageGb = 1, - MaxUsers = 6, + MaxUsers = 5, HasAdditionalStorageOption = true, HasPremiumAccessOption = true, @@ -287,6 +287,7 @@ namespace Bit.Core.Utilities BaseStorageGb = 1, MaxUsers = 6, + HasAdditionalStorageOption = true, TrialPeriodDays = 7, HasSelfHost = true,