diff --git a/src/Billing/Startup.cs b/src/Billing/Startup.cs index ab1a7b3e2..bc288235c 100644 --- a/src/Billing/Startup.cs +++ b/src/Billing/Startup.cs @@ -87,7 +87,7 @@ namespace Bit.Billing return true; } - return e.Level >= LogEventLevel.Error; + return e.Level >= LogEventLevel.Warning; }); if(env.IsDevelopment()) diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index aff5be83f..fd64d07f0 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -8,6 +8,7 @@ using System.Linq; using Bit.Core.Models.Business; using Bit.Core.Enums; using Bit.Core.Repositories; +using Microsoft.Extensions.Logging; namespace Bit.Core.Services { @@ -17,11 +18,13 @@ namespace Bit.Core.Services private const string StoragePlanId = "storage-gb-annually"; private readonly ITransactionRepository _transactionRepository; + private readonly ILogger _logger; private readonly Braintree.BraintreeGateway _btGateway; public StripePaymentService( ITransactionRepository transactionRepository, - GlobalSettings globalSettings) + GlobalSettings globalSettings, + ILogger logger) { _btGateway = new Braintree.BraintreeGateway { @@ -32,6 +35,7 @@ namespace Bit.Core.Services PrivateKey = globalSettings.Braintree.PrivateKey }; _transactionRepository = transactionRepository; + _logger = logger; } public async Task PurchaseOrganizationAsync(Organization org, PaymentMethodType paymentMethodType, @@ -970,10 +974,10 @@ namespace Bit.Core.Services var customerService = new CustomerService(); Customer customer = null; var customerExists = subscriber.Gateway == GatewayType.Stripe && - !string.IsNullOrWhiteSpace(subscriber.GatewaySubscriptionId); + !string.IsNullOrWhiteSpace(subscriber.GatewayCustomerId); if(customerExists) { - customer = await customerService.GetAsync(subscriber.GatewaySubscriptionId); + customer = await customerService.GetAsync(subscriber.GatewayCustomerId); } else {