From 02d2abd17276e079459025c64d69b884b722a869 Mon Sep 17 00:00:00 2001 From: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:04:08 +0100 Subject: [PATCH] initial commit (#3874) Signed-off-by: Cy Okeke --- src/Core/Services/Implementations/StripePaymentService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index 182e08d524a2..ee4c977406eb 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -800,7 +800,8 @@ private async Task FinalizeSubscriptionChangeAsync(IStorableSubscriber s SubscriptionBillingCycleAnchor = SubscriptionBillingCycleAnchor.Now }); - immediatelyInvoice = upcomingInvoiceWithChanges.AmountRemaining >= 50000; + var isAnnualPlan = sub?.Items?.Data.FirstOrDefault()?.Plan?.Interval == "year"; + immediatelyInvoice = isAnnualPlan && upcomingInvoiceWithChanges.AmountRemaining >= 50000; subUpdateOptions.BillingCycleAnchor = immediatelyInvoice ? SubscriptionBillingCycleAnchor.Now