From 0d4ac29bc70a1b71b777d8641e024f43fe4b8af6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 20 Jul 2018 17:00:05 -0400 Subject: [PATCH] fix cancelled typo in areas --- src/Core/Models/Business/BillingInfo.cs | 2 +- src/Core/Services/Implementations/BraintreePaymentService.cs | 4 ++-- src/Core/Services/Implementations/StripePaymentService.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/Models/Business/BillingInfo.cs b/src/Core/Models/Business/BillingInfo.cs index 64a2ea128a..1e1d5d9bf8 100644 --- a/src/Core/Models/Business/BillingInfo.cs +++ b/src/Core/Models/Business/BillingInfo.cs @@ -99,7 +99,7 @@ namespace Bit.Core.Models.Business PeriodEndDate = sub.CurrentPeriodEnd; CancelledDate = sub.CanceledAt; CancelAtEndDate = sub.CancelAtPeriodEnd; - Cancelled = sub.Status == "cancelled"; + Cancelled = sub.Status == "canceled" || sub.Status == "unpaid"; if(sub.Items?.Data != null) { Items = sub.Items.Data.Select(i => new BillingSubscriptionItem(i)); diff --git a/src/Core/Services/Implementations/BraintreePaymentService.cs b/src/Core/Services/Implementations/BraintreePaymentService.cs index 78d6fc601f..43ec65ae01 100644 --- a/src/Core/Services/Implementations/BraintreePaymentService.cs +++ b/src/Core/Services/Implementations/BraintreePaymentService.cs @@ -164,8 +164,8 @@ namespace Bit.Core.Services if(sub != null) { var cancelAtEndDate = !sub.NeverExpires.GetValueOrDefault(); - var cancelled = sub.Status == SubscriptionStatus.CANCELED; - if(!cancelled && !cancelAtEndDate && sub.NextBillingDate.HasValue) + var canceled = sub.Status == SubscriptionStatus.CANCELED; + if(!canceled && !cancelAtEndDate && sub.NextBillingDate.HasValue) { return new BillingInfo.BillingInvoice(sub); } diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index ddf6c04f18..8f74177f50 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -193,9 +193,9 @@ namespace Bit.Core.Services throw new GatewayException("Subscription was not found."); } - if(sub.CanceledAt.HasValue || sub.Status == "cancelled") + if(sub.CanceledAt.HasValue || sub.Status == "canceled" || sub.Status == "unpaid") { - // Already cancelled + // Already canceled return; }