Browse Source

Check to see if cancellation comment is populated before disablement checks (#5468)

Alex Morask 10 months ago committed by Alex Morask
parent
commit
382a8f1ac0
No known key found for this signature in database
GPG Key ID: 23E38285B743E3A8
  1. 11
      src/Billing/Services/Implementations/SubscriptionDeletedHandler.cs

11
src/Billing/Services/Implementations/SubscriptionDeletedHandler.cs

@ -40,10 +40,15 @@ public class SubscriptionDeletedHandler : ISubscriptionDeletedHandler @@ -40,10 +40,15 @@ public class SubscriptionDeletedHandler : ISubscriptionDeletedHandler
return;
}
if (organizationId.HasValue &&
subscription.CancellationDetails.Comment != providerMigrationCancellationComment &&
!subscription.CancellationDetails.Comment.Contains(addedToProviderCancellationComment))
if (organizationId.HasValue)
{
if (!string.IsNullOrEmpty(subscription.CancellationDetails?.Comment) &&
(subscription.CancellationDetails.Comment == providerMigrationCancellationComment ||
subscription.CancellationDetails.Comment.Contains(addedToProviderCancellationComment)))
{
return;
}
await _organizationService.DisableAsync(organizationId.Value, subscription.CurrentPeriodEnd);
}
else if (userId.HasValue)

Loading…
Cancel
Save