Skip to content

Commit

Permalink
Merge pull request #1417 from guardian/restrict-sp-offer-billing-period
Browse files Browse the repository at this point in the history
Restrict supporter plus offers to those with monthly billing periods
  • Loading branch information
rBangay authored Nov 15, 2024
2 parents 16068c6 + c2f45a7 commit 984f8e5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions client/components/mma/cancel/CancellationReasonReview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { cancelAlternativeUrlPartLookup } from '@/shared/cancellationUtilsAndTyp
import { featureSwitches } from '@/shared/featureSwitches';
import type { TrueFalsePending } from '@/shared/generalTypes';
import { DATE_FNS_INPUT_FORMAT, parseDate } from '../../../../shared/dates';
import { MDA_TEST_USER_HEADER } from '../../../../shared/productResponse';
import {
getMainPlan,
isPaidSubscriptionPlan,
MDA_TEST_USER_HEADER,
} from '../../../../shared/productResponse';
import type {
ProductTypeWithCancellationFlow,
WithProductType,
Expand Down Expand Up @@ -261,9 +265,12 @@ const ConfirmCancellationAndReturnRow = (
const { productDetail, productType } = useContext(
CancellationContext,
) as CancellationContextInterface;
const mainPlan = getMainPlan(productDetail.subscription);
const isSupporterPlusAndFreePeriodOfferIsActive =
featureSwitches.supporterplusCancellationOffer &&
productType.productType === 'supporterplus';
productType.productType === 'supporterplus' &&
isPaidSubscriptionPlan(mainPlan) &&
mainPlan.billingPeriod.toLowerCase() === 'month';

const isContributionAndBreakFeatureIsActive =
featureSwitches.contributionCancellationPause &&
Expand Down

0 comments on commit 984f8e5

Please sign in to comment.