getCMSForMetadataKey()

in libs/payments/legacy/src/lib/plan-mapper.util.ts [80:121]


  getCMSForMetadataKey(stripeMetadataKey: StripeMetadataKeysForCMS) {
    switch (stripeMetadataKey) {
      case StripeMetadataKeysForCMS.DetailsLine1:
        return this.purchaseDetails.details[0];
      case StripeMetadataKeysForCMS.DetailsLine2:
        return this.purchaseDetails.details[1];
      case StripeMetadataKeysForCMS.DetailsLine3:
        return this.purchaseDetails.details[2];
      case StripeMetadataKeysForCMS.DetailsLine4:
        return this.purchaseDetails.details[3];
      case StripeMetadataKeysForCMS.Subtitle:
        return this.purchaseDetails.subtitle;
      case StripeMetadataKeysForCMS.WebIcon:
        return this.purchaseDetails.webIcon;
      case StripeMetadataKeysForCMS.PrivacyNotice:
        return this.commonContent.privacyNoticeUrl;
      case StripeMetadataKeysForCMS.PrivacyNoticeDownload:
        return this.commonContent.privacyNoticeDownloadUrl;
      case StripeMetadataKeysForCMS.ToS:
        return this.commonContent.termsOfServiceUrl;
      case StripeMetadataKeysForCMS.ToSDownload:
        return this.commonContent.termsOfServiceDownloadUrl;
      case StripeMetadataKeysForCMS.CancellationURL:
        return this.commonContent.cancellationUrl;
      case StripeMetadataKeysForCMS.EmailIcon:
        return this.commonContent.emailIcon;
      case StripeMetadataKeysForCMS.SuccessAction:
        return this.commonContent.successActionButtonUrl;
      case StripeMetadataKeysForCMS.SuccessActionLabel:
        return this.commonContent.successActionButtonLabel;
      case StripeMetadataKeysForCMS.NewsletterLabel:
        return this.commonContent.newsletterLabelTextCode;
      case StripeMetadataKeysForCMS.NewsletterSlug: {
        return (
          this.commonContent.newsletterSlug &&
          [...this.commonContent.newsletterSlug].sort().join(',')
        );
      }
      default:
        return undefined;
    }
  }