Browse Source

Merge pull request #34534 from overleaf/rh-rm-recurly

[web] Remove conditional Recurly checkout page

GitOrigin-RevId: 5bb773080bba682628f0f5428c72b7dff75b6015
roo hutton 1 month ago
parent
commit
1dfe6e60b3

+ 0 - 60
services/web/app/src/Features/Subscription/SubscriptionHandler.mjs

@@ -9,7 +9,6 @@ import SubscriptionUpdater from './SubscriptionUpdater.mjs'
 import LimitationsManager from './LimitationsManager.mjs'
 import EmailHandler from '../Email/EmailHandler.mjs'
 import { callbackify } from '@overleaf/promise-utils'
-import UserUpdater from '../User/UserUpdater.mjs'
 import Modules from '../../infrastructure/Modules.mjs'
 import { AI_ADD_ON_CODE } from './AiHelper.mjs'
 import CustomerIoPlanHelpers from './CustomerIoPlanHelpers.mjs'
@@ -20,61 +19,6 @@ import AiFeatureUsageRateLimiter from '../../infrastructure/rate-limiters/AiFeat
  * @import { PaymentProviderSubscriptionChange } from './PaymentProviderEntities.mjs'
  */
 
-/**
- * @param {any} userId
- */
-async function validateNoSubscriptionInRecurly(userId) {
-  let subscriptions =
-    await RecurlyWrapper.promises.listAccountActiveSubscriptions(userId)
-
-  if (!subscriptions) {
-    subscriptions = []
-  }
-
-  if (subscriptions.length > 0) {
-    await SubscriptionUpdater.promises.syncSubscription(
-      subscriptions[0],
-      userId
-    )
-
-    return false
-  }
-
-  return true
-}
-
-/**
- * @param {any} user
- * @param {any} subscriptionDetails
- * @param {any} recurlyTokenIds
- */
-async function createSubscription(user, subscriptionDetails, recurlyTokenIds) {
-  const valid = await validateNoSubscriptionInRecurly(user._id)
-
-  if (!valid) {
-    throw new Error('user already has subscription in recurly')
-  }
-
-  const recurlySubscription = await RecurlyWrapper.promises.createSubscription(
-    user,
-    subscriptionDetails,
-    recurlyTokenIds
-  )
-
-  if (recurlySubscription.trial_started_at) {
-    const trialStartedAt = new Date(recurlySubscription.trial_started_at)
-    await UserUpdater.promises.updateUser(
-      { _id: user._id, lastTrial: { $not: { $gt: trialStartedAt } } },
-      { $set: { lastTrial: trialStartedAt } }
-    )
-  }
-
-  await SubscriptionUpdater.promises.syncSubscription(
-    recurlySubscription,
-    user._id
-  )
-}
-
 /**
  * Preview the effect of changing the subscription plan
  *
@@ -431,8 +375,6 @@ async function pauseSubscription(user, pauseCycles) {
 }
 
 export default {
-  validateNoSubscriptionInRecurly: callbackify(validateNoSubscriptionInRecurly),
-  createSubscription: callbackify(createSubscription),
   previewSubscriptionChange: callbackify(previewSubscriptionChange),
   updateSubscription: callbackify(updateSubscription),
   cancelPendingSubscriptionChange: callbackify(cancelPendingSubscriptionChange),
@@ -448,8 +390,6 @@ export default {
   pauseSubscription: callbackify(pauseSubscription),
   resumeSubscription: callbackify(resumeSubscription),
   promises: {
-    validateNoSubscriptionInRecurly,
-    createSubscription,
     previewSubscriptionChange,
     updateSubscription,
     cancelPendingSubscriptionChange,

+ 0 - 17
services/web/frontend/extracted-translations.json

@@ -148,7 +148,6 @@
   "allows_to_search_by_author_title_etc_possible_to_pull_results_directly_from_your_reference_manager_if_connected": "",
   "an_email_has_already_been_sent_to": "",
   "an_error_occured_while_restoring_project": "",
-  "an_error_occurred_when_verifying_the_coupon_code": "",
   "and_much_more": "",
   "anonymous": "",
   "anyone": "",
@@ -250,10 +249,6 @@
   "caption_below": "",
   "captions": "",
   "capture": "",
-  "card_details": "",
-  "card_details_are_not_valid": "",
-  "card_must_be_authenticated_by_3dsecure": "",
-  "card_payment": "",
   "careers": "",
   "category_arrows": "",
   "category_greek": "",
@@ -262,7 +257,6 @@
   "category_relations": "",
   "center": "",
   "change": "",
-  "change_currency": "",
   "change_email_address": "",
   "change_language": "",
   "change_owner": "",
@@ -391,7 +385,6 @@
   "could_not_save_reference_to_bib_file_forbidden": "",
   "country": "",
   "country_flag": "",
-  "coupon_code": "",
   "coupon_code_is_not_valid_for_selected_plan": "",
   "coupons_not_included": "",
   "create": "",
@@ -588,8 +581,6 @@
   "editor_theme_dark": "",
   "editor_theme_light": "",
   "edits_become_suggestions": "",
-  "educational_disclaimer": "",
-  "educational_disclaimer_heading": "",
   "educational_percent_discount_applied": "",
   "email": "",
   "email_address": "",
@@ -916,7 +907,6 @@
   "how_we_use_your_data": "",
   "how_we_use_your_data_explanation": "",
   "html_export_feedback_message": "",
-  "i_confirm_am_student": "",
   "i_want_to_add_a_po_number": "",
   "i_want_to_stay": "",
   "id": "",
@@ -1324,7 +1314,6 @@
   "normal": "",
   "normally_x_price_per_month": "",
   "normally_x_price_per_year": "",
-  "not_a_student": "",
   "not_managed": "",
   "not_now": "",
   "notification": "",
@@ -1512,7 +1501,6 @@
   "problem_talking_to_publishing_service": "",
   "problem_with_subscription_contact_us": "",
   "proceed_to_paypal": "",
-  "proceeding_to_paypal_takes_you_to_the_paypal_site_to_pay": "",
   "processing": "",
   "processing_uppercase": "",
   "progress_bar_percentage": "",
@@ -1800,7 +1788,6 @@
   "select_tax_id_type": "",
   "select_user": "",
   "select_user_role": "",
-  "selected": "",
   "selected_lowercase": "",
   "selected_lowercase_plural": "",
   "selection_deleted": "",
@@ -1868,7 +1855,6 @@
   "something_went_wrong": "",
   "something_went_wrong_canceling_your_subscription": "",
   "something_went_wrong_loading_pdf_viewer": "",
-  "something_went_wrong_processing_the_request": "",
   "something_went_wrong_rendering_pdf": "",
   "something_went_wrong_rendering_pdf_expected": "",
   "something_went_wrong_server": "",
@@ -1964,7 +1950,6 @@
   "strongly_agree": "",
   "strongly_disagree": "",
   "student": "",
-  "student_disclaimer": "",
   "subject": "",
   "subject_area": "",
   "submit_title": "",
@@ -1996,7 +1981,6 @@
   "switch_compile_mode_for_faster_draft_compilation": "",
   "switch_to_editor": "",
   "switch_to_pdf": "",
-  "switch_to_standard_plan": "",
   "symbol": "",
   "symbol_palette": "",
   "sync": "",
@@ -2343,7 +2327,6 @@
   "value_must_be_a_whole_number": "",
   "value_must_be_at_least_x": "",
   "vat": "",
-  "vat_number": "",
   "verification": "",
   "verification_code": "",
   "verified": "",

+ 0 - 9
services/web/locales/da.json

@@ -120,7 +120,6 @@
   "alternatively_create_new_institution_account": "Alternativt kan du oprette en <b>ny konto</b> med din institutionelle e-mailaddresse (<b>__email__</b>), ved at klikke <b>__clickText__</b>.",
   "an_email_has_already_been_sent_to": "En e-mail er allerede blevet sendt til <0>__email__</0>. Vent lidt og prøv igen senere.",
   "an_error_occured_while_restoring_project": "En fejl opstod under gendannelsen af projektet",
-  "an_error_occurred_when_verifying_the_coupon_code": "En fejl opstod under valideringen af rabatkoden",
   "and": "og",
   "annual": "Årlig",
   "anonymous": "Anonym",
@@ -207,10 +206,6 @@
   "cant_see_what_youre_looking_for_question": "Er der noget, der mangler?",
   "caption_above": "Billedtekst ovenfor",
   "caption_below": "Billedtekst nedenfor",
-  "card_details": "Betalingskortsoplysninger",
-  "card_details_are_not_valid": "Betalingskortsoplysningerne er ugyldige",
-  "card_must_be_authenticated_by_3dsecure": "Betalingskortet skal godkendes med 3D Secure før du kan fortsætte",
-  "card_payment": "Kortbetaling",
   "careers": "Karriere",
   "categories": "Kategorier",
   "category_arrows": "Pile",
@@ -221,7 +216,6 @@
   "center": "Centreret",
   "certificate": "Certifikat",
   "change": "Ændr",
-  "change_currency": "Ændr valuta",
   "change_language": "Skift sprog",
   "change_owner": "Skift ejer",
   "change_password": "Skift Kodeord",
@@ -1339,7 +1333,6 @@
   "problem_talking_to_publishing_service": "Der er et problem med vores udgivelses tjeneste, prøv igen om nogle få minutter",
   "problem_with_subscription_contact_us": "Der er et problem med dit abonnement. Kontakt os venligst for mere information.",
   "proceed_to_paypal": "Fortsæt til PayPal",
-  "proceeding_to_paypal_takes_you_to_the_paypal_site_to_pay": "At fortsætte til PayPal fører dig til PayPals side for at betale for dit abonnement.",
   "processing": "processere",
   "processing_uppercase": "Behandler",
   "processing_your_request": "Vent venligst, mens vi behandler din forespørgsel.",
@@ -1656,7 +1649,6 @@
   "something_went_wrong": "Noget gik galt",
   "something_went_wrong_canceling_your_subscription": "Der gik noget galt med annulleringen af dit abonnement. Du bliver nødt til at kontakte supporten.",
   "something_went_wrong_loading_pdf_viewer": "Noget gik galt under indlæsningen af PDF viseren. Dette kan være forårsaget af problemer som <0>midlertidige netværksproblemer</0> eller en <0>forældet web browser</0>. Følg venligst <1>fejlsøgningskridtene for adgang, indlæsning, og visningsproblemer</1>. Hvis problemet fortsætter <2>fortæl os om det</2>.",
-  "something_went_wrong_processing_the_request": "Noget gik galt under behandlingen af forespørgslen",
   "something_went_wrong_rendering_pdf": "Noget gik galt i oversættelsen af denne PDF",
   "something_went_wrong_rendering_pdf_expected": "Der opstod et problem under visningen af PDFen. <0>Genkompiler</0>",
   "something_went_wrong_server": "Noget gik galt. Prøv venligst igen.",
@@ -1738,7 +1730,6 @@
   "store_your_work": "Gem jeres arbejde på jeres egen infrastruktur",
   "stretch_width_to_text": "Stræk bredden efter teksten",
   "student": "Studerende",
-  "student_disclaimer": "Studierabatten er gælder for alle studerende ved gymnasier og videregående uddannelsesinstitutioner. Vi kontakter dig muligvis for at bekræfte at du kvalificerer dig til denne rabat. ",
   "students": "Studerende",
   "subject": "Emne",
   "submit": "indsend",

+ 0 - 8
services/web/locales/de.json

@@ -159,7 +159,6 @@
   "alternatively_create_new_institution_account": "Alternativ kannst du mit deiner institutionellen E-Mail-Adresse (<b>__email__</b>) ein <b>neues Konto</b> erstellen. Klicke hierfür auf <b>„__clickText__“</b>.",
   "an_email_has_already_been_sent_to": "Es wurde bereits eine E-Mail an <0>__email__</0> gesendet. Bitte warte einen Moment und versuche es später erneut.",
   "an_error_occured_while_restoring_project": "Beim Wiederherstellen des Projekts ist ein Fehler aufgetreten.",
-  "an_error_occurred_when_verifying_the_coupon_code": "Beim Überprüfen des Gutscheincodes ist ein Fehler aufgetreten",
   "and": "und",
   "annual": "Jährlich",
   "annual_discount": "Jährlicher Rabatt",
@@ -256,10 +255,6 @@
   "cant_find_email": "Diese E-Mail-Adresse ist leider nicht registriert.",
   "cant_find_page": "Entschuldigung, wir können die Seite, die du suchst, nicht finden.",
   "cant_see_what_youre_looking_for_question": "Du kannst nicht finden, wonach du suchst?",
-  "card_details": "Kartendaten",
-  "card_details_are_not_valid": "Die Kartendaten sind nicht gültig",
-  "card_must_be_authenticated_by_3dsecure": "Deine Karte muss mit 3D Secure authentifiziert werden, bevor du fortfahren kannst",
-  "card_payment": "Kartenzahlung",
   "careers": "Karriere",
   "categories": "Kategorien",
   "category_arrows": "Pfeile",
@@ -270,7 +265,6 @@
   "center": "Zentrieren",
   "certificate": "Zertifikat",
   "change": "Ändern",
-  "change_currency": "Währung ändern",
   "change_language": "Sprache ändern",
   "change_owner": "Besitzer ändern",
   "change_password": "Passwort ändern",
@@ -1029,7 +1023,6 @@
   "normal": "Normal",
   "normally_x_price_per_month": "Normalerweise __price__ pro Monat",
   "normally_x_price_per_year": "Normalerweise __price__ pro Jahr",
-  "not_a_student": "Kein Student?",
   "not_found_error_from_the_supplied_url": "Der Link zum Öffnen dieses Inhalts auf Overleaf verwies auf eine Datei, die nicht gefunden werden konnte. Wenn dies bei Links auf einer bestimmten Website weiterhin auftritt, melde dies bitte dort.",
   "not_managed": "Nicht verwaltet",
   "not_now": "Nicht jetzt",
@@ -1377,7 +1370,6 @@
   "stops_compiling_after_the_first_error_so_you_can_fix_issues_one_at_a_time": "Stoppt das Kompilieren beim ersten Fehler, damit du Probleme einzeln beheben kannst",
   "store_your_work": "Speichere deine Arbeit auf deiner eigenen Infrastruktur",
   "student": "Student",
-  "student_disclaimer": "Der Bildungsrabatt gilt für alle Studierenden an weiterführenden und höheren Bildungseinrichtungen (Schulen und Universitäten). Wir können dich kontaktieren, damit du den Anspruch auf den Rabatt bestätigst.",
   "subject": "Betreff",
   "submit": "Absenden",
   "submit_title": "Einreichen",

+ 0 - 14
services/web/locales/en.json

@@ -192,7 +192,6 @@
   "alternatively_create_new_institution_account": "Alternatively, you can create a <b>new account</b> with your institution email (<b>__email__</b>) by clicking <b>__clickText__</b>.",
   "an_email_has_already_been_sent_to": "An email has already been sent to <0>__email__</0>. Please wait and try again later.",
   "an_error_occured_while_restoring_project": "An error occured while restoring the project",
-  "an_error_occurred_when_verifying_the_coupon_code": "An error occurred when verifying the coupon code",
   "and": "and",
   "and_much_more": "and much more",
   "annual": "Annual",
@@ -335,10 +334,6 @@
   "caption_below": "Caption below",
   "captions": "Captions",
   "capture": "Capture",
-  "card_details": "Card details",
-  "card_details_are_not_valid": "Card details are not valid",
-  "card_must_be_authenticated_by_3dsecure": "Your card must be authenticated with 3D Secure before continuing",
-  "card_payment": "Card payment",
   "careers": "Careers",
   "categories": "Categories",
   "category_arrows": "Arrows",
@@ -349,7 +344,6 @@
   "center": "Center",
   "certificate": "Certificate",
   "change": "Change",
-  "change_currency": "Change currency",
   "change_email_address": "Change email address",
   "change_language": "Change language",
   "change_owner": "Change owner",
@@ -767,8 +761,6 @@
   "editor_theme_dark": "Dark editor theme",
   "editor_theme_light": "Light editor theme",
   "edits_become_suggestions": "Edits become suggestions",
-  "educational_disclaimer": "I confirm that users will be students or faculty using Overleaf primarily for study and teaching, and can provide evidence of this if requested.",
-  "educational_disclaimer_heading": "Educational discount confirmation",
   "educational_discount_tooltip": "Available to groups at degree-granting institutions.",
   "educational_percent_discount_applied": "__percent__% educational discount applied!",
   "email": "Email",
@@ -1186,7 +1178,6 @@
   "how_we_use_your_data_explanation": "<0>Please help us continue to improve Overleaf by answering a few quick questions. Your answers will help us and our corporate group understand more about our user base. We may use this information to improve your Overleaf experience, for example by providing personalized onboarding, upgrade prompts, help suggestions, and tailored marketing communications (if you’ve opted-in to receive them).</0><1>For more details on how we use your personal data, please see our <0>Privacy Notice</0>.</1>",
   "html_export_feedback_message": "Exporting as HTML is a new feature. <0>Let us know what you think</0>",
   "hundreds_templates_info": "Produce beautiful documents starting from our gallery of LaTeX templates for journals, conferences, theses, reports, CVs and much more.",
-  "i_confirm_am_student": "I confirm that I am currently a student.",
   "i_want_to_add_a_po_number": "I want to add a PO number",
   "i_want_to_stay": "I want to stay",
   "id": "ID",
@@ -1727,7 +1718,6 @@
   "normal": "Normal",
   "normally_x_price_per_month": "Normally __price__ per month",
   "normally_x_price_per_year": "Normally __price__ per year",
-  "not_a_student": "Not a student?",
   "not_found": "Not found",
   "not_found_error_from_the_supplied_url": "The link to open this content on Overleaf pointed to a file that could not be found. If this keeps happening for links on a particular site, please report this to them.",
   "not_managed": "Not managed",
@@ -2000,7 +1990,6 @@
   "problem_talking_to_publishing_service": "There is a problem with our publishing service, please try again in a few minutes",
   "problem_with_subscription_contact_us": "There is a problem with your subscription. Please contact us for more information.",
   "proceed_to_paypal": "Proceed to PayPal",
-  "proceeding_to_paypal_takes_you_to_the_paypal_site_to_pay": "Proceeding to PayPal will take you to the PayPal site to pay for your subscription.",
   "processing": "processing",
   "processing_uppercase": "Processing",
   "processing_your_request": "Please wait while we process your request.",
@@ -2431,7 +2420,6 @@
   "something_went_wrong": "Something went wrong",
   "something_went_wrong_canceling_your_subscription": "Something went wrong canceling your subscription. Please contact Support.",
   "something_went_wrong_loading_pdf_viewer": "Something went wrong loading the PDF viewer. This might be caused by issues like <0>temporary network problems</0> or an <0>outdated web browser</0>. Please follow the <1>troubleshooting steps for access, loading and display problems</1>. If the issue persists, please <2>let us know</2>.",
-  "something_went_wrong_processing_the_request": "Something went wrong processing the request",
   "something_went_wrong_rendering_pdf": "Something went wrong while rendering this PDF.",
   "something_went_wrong_rendering_pdf_expected": "There was an issue displaying this PDF. <0>Please recompile</0>",
   "something_went_wrong_server": "Something went wrong. Please try again.",
@@ -2545,7 +2533,6 @@
   "strongly_agree": "Strongly agree",
   "strongly_disagree": "Strongly disagree",
   "student": "Student",
-  "student_disclaimer": "The educational discount applies to all students at secondary and postsecondary institutions (schools and universities). We may contact you to confirm that you’re eligible for the discount.",
   "student_discount_tooltip": "Available to students currently enrolled at a degree-granting institution.",
   "student_verification_required": "Student verification required",
   "students": "Students",
@@ -2586,7 +2573,6 @@
   "switch_plans_whenever_your_needs_change": "Switch plans whenever your needs change.",
   "switch_to_editor": "Switch to editor",
   "switch_to_pdf": "Switch to PDF",
-  "switch_to_standard_plan": "Switch to Standard plan",
   "symbol": "Symbol",
   "symbol_palette": "Symbol palette",
   "symbol_palette_explanation": "Insert math symbols with the click of a button.",

+ 0 - 6
services/web/locales/es.json

@@ -110,7 +110,6 @@
   "alternatively_create_new_institution_account": "Alternativamente, puede crear una <b>nueva cuenta</b> con su correo institucional (<b>__email__</b>) haciendo click en <b>__clickText__</b>.",
   "an_email_has_already_been_sent_to": "Ya se ha enviado un correo electrónico a <0>__email__</0>. Espere e inténtelo de nuevo más tarde.",
   "an_error_occured_while_restoring_project": "Se ha producido un error al restaurar el proyecto",
-  "an_error_occurred_when_verifying_the_coupon_code": "Se ha producido un error al verificar el código del cupón",
   "and": "y",
   "annual": "Anual",
   "anonymous": "Anónimo",
@@ -187,10 +186,6 @@
   "cant_see_what_youre_looking_for_question": "¿No encuentra lo que busca?",
   "caption_above": "Pie de foto encima",
   "caption_below": "Pie de foto debajo",
-  "card_details": "Datos de la tarjeta",
-  "card_details_are_not_valid": "Los datos de la tarjeta no son válidos",
-  "card_must_be_authenticated_by_3dsecure": "Su tarjeta debe ser autenticada con 3D Secure antes de continuar",
-  "card_payment": "Pago con tarjeta",
   "careers": "Empleo",
   "category_arrows": "Flechas",
   "category_greek": "Griego",
@@ -200,7 +195,6 @@
   "center": "Centro",
   "certificate": "Certificado",
   "change": "Cambiar",
-  "change_currency": "Cambiar divisa",
   "change_password": "Cambiar contraseña",
   "change_plan": "Cambiar plan",
   "change_to_this_plan": "Cambiar a este plan",

+ 0 - 7
services/web/locales/fr.json

@@ -102,7 +102,6 @@
   "already_have_sl_account": "Avez-vous déjà un compte __appName__ ?",
   "also": "Aussi",
   "alternatively_create_new_institution_account": "Autrement, vous pouvez créer un <b>nouveau compte</b> avec votre adresse courriel institutionnelle (<b>__email__</b>) en cliquant <b>__clickText__</b>.",
-  "an_error_occurred_when_verifying_the_coupon_code": "Une erreur est survenue lors de la vérification du code coupon",
   "and": "et",
   "annual": "Annuel",
   "anonymous": "Anonyme",
@@ -173,10 +172,6 @@
   "cant_find_email": "Cette adresse électronique n’est pas connue, désolé.",
   "cant_find_page": "Désolé, nous ne trouvons pas la page que vous cherchez.",
   "cant_see_what_youre_looking_for_question": "Vous ne trouvez pas ce que vous cherchez ?",
-  "card_details": "Détails de la carte",
-  "card_details_are_not_valid": "Les informations de carte de paiement sont invalides",
-  "card_must_be_authenticated_by_3dsecure": "Vous devez authentifier votre carte avec 3D Secure avant de poursuivre",
-  "card_payment": "Paiement par carte",
   "careers": "Carrières",
   "category_arrows": "Flèches",
   "category_greek": "Grec",
@@ -184,7 +179,6 @@
   "category_operators": "Opérateurs",
   "category_relations": "Relations",
   "change": "Modifier",
-  "change_currency": "Changer de devise",
   "change_owner": "Changer de propriétaire",
   "change_password": "Changer de mot de passe",
   "change_password_in_account_settings": "Changer le mot de passe dans les Paramètres du Compte",
@@ -1006,7 +1000,6 @@
   "stop_on_validation_error": "Vérifier la syntaxe avant la compilation",
   "store_your_work": "Stockez vos travaux sur votre propre infrastructure",
   "student": "Étudiant·e",
-  "student_disclaimer": "Cette réduction pour l’éducation s’applique à tous les étudiant·e·s des établissements du secondaire ou du supérieur (lycées et universités). Nous pouvons être amenés à vous contacter pour confirmer votre éligibilité à cette réduction.",
   "subject": "Objet",
   "submit": "envoyer",
   "submit_title": "Publier",

+ 0 - 1
services/web/locales/pt.json

@@ -545,7 +545,6 @@
   "stop_compile": "Parar compilação",
   "stop_on_validation_error": "Verificar sintaxe antes de compilar",
   "student": "Estudante",
-  "student_disclaimer": "O desconto educacional se aplica à todos os estudantes de instituições secundárias e pós-secundárias (escolas e universidades). Nos poderemos entrar em contato com você para confirmar se você é elegível para o desconto.",
   "subject": "Assunto",
   "submit": "enviar",
   "subscribe": "Inscrever",

+ 0 - 2
services/web/locales/sv.json

@@ -611,7 +611,6 @@
   "problem_talking_to_publishing_service": "Det har uppstått ett problem på vår publiceringsserver, vänligen försök igen om några minuter",
   "problem_with_subscription_contact_us": "Det har uppstått ett problem med din prenumeration. Vänligen kontakta oss för mer information.",
   "proceed_to_paypal": "Fortsätt till PayPal",
-  "proceeding_to_paypal_takes_you_to_the_paypal_site_to_pay": "Om du går vidare till PayPal kommer du till PayPal-webbplatsen där du kan betala för din prenumeration.",
   "processing": "behandlar",
   "processing_your_request": "Vänligen vänta medan vi behandlar din begäran.",
   "professional": "Professionell",
@@ -758,7 +757,6 @@
   "stop_on_validation_error": "Kontrollera syntax innan kompilering",
   "store_your_work": "Lagra ditt arbete på din egen infrastruktur",
   "student": "Student",
-  "student_disclaimer": "Studentrabatten gäller för alla studenter på gymnasienivå eller högre. Vi kan komma att kontakta dig för att bekräfta din behörighet för rabatten.",
   "subject": "Ämne",
   "submit": "Skicka",
   "submit_title": "Skicka in",

+ 0 - 14
services/web/locales/zh-CN.json

@@ -136,7 +136,6 @@
   "alternatively_create_new_institution_account": "或者,您可以通过单击<b>__clickText__</b>来使用机构电子邮件(<b>__email__</b>)创建一个<b>新帐户</b>。",
   "an_email_has_already_been_sent_to": "一封电子邮件已经被发送给<0>__email__</0>。请稍后再尝试。",
   "an_error_occured_while_restoring_project": "还原项目时出错",
-  "an_error_occurred_when_verifying_the_coupon_code": "验证优惠券代码时出错",
   "and": "和",
   "annual": "每年",
   "annual_discount": "年度折扣",
@@ -246,10 +245,6 @@
   "cant_see_what_youre_looking_for_question": "找不到?",
   "caption_above": "标题在表格上方",
   "caption_below": "标题在表格下方",
-  "card_details": "信用卡详情",
-  "card_details_are_not_valid": "信用卡信息无效",
-  "card_must_be_authenticated_by_3dsecure": "在继续之前,您的卡必须通过3D安全验证",
-  "card_payment": "信用卡支付",
   "careers": "工作与职业",
   "categories": "类别",
   "category_arrows": "箭头字符",
@@ -260,7 +255,6 @@
   "center": "居中",
   "certificate": "证书",
   "change": "修改",
-  "change_currency": "更改货币",
   "change_language": "更改语言",
   "change_owner": "更改所有者",
   "change_password": "更换密码",
@@ -578,8 +572,6 @@
   "editor_only": "仅编辑器",
   "editor_theme": "编辑器主题",
   "edits_become_suggestions": "编辑成建议修改",
-  "educational_disclaimer": "我确认用户是主要使用 Overleaf 进行学习和教学的学生或教师,并且可以在被要求时提供证据。",
-  "educational_disclaimer_heading": "教育折扣确认",
   "educational_discount_tooltip": "适用于学位授予机构内的团队。",
   "educational_percent_discount_applied": "应用 __percent__% 教育折扣!",
   "email": "电子邮件",
@@ -911,7 +903,6 @@
   "how_we_use_your_data": "我们如何使用您的数据",
   "how_we_use_your_data_explanation": "<0>请回答几个简短的问题,帮助我们继续改进Overleaf。您的回答将帮助我们和我们的企业集团更多地了解我们的用户群体。我们可能会使用这些信息来改善您的 Overleaf 体验,例如提供个性化的入门、升级提示、帮助建议和量身定制的营销沟通(如果您选择接收这些信息)</0><1>有关我们如何使用您的个人数据的更多详细信息,请参阅我们的<0>隐私声明</0></1>",
   "hundreds_templates_info": "从我们的 LaTeX 模板库开始,为期刊、会议、论文、报告、简历等制作漂亮的文档。",
-  "i_confirm_am_student": "我确认我目前是一名学生。",
   "i_want_to_stay": "我要留下",
   "id": "ID",
   "if_have_existing_can_link": "如果您在另一封电子邮件中有一个现有的 <b>__appName__</b> 帐户,您可以通过单击 <b>__clickText__</b> 将其链接到您的 <b>__institutionName__</b> 账户。",
@@ -1328,7 +1319,6 @@
   "normal": "常规",
   "normally_x_price_per_month": "通常每月__price__",
   "normally_x_price_per_year": "通常每年__price__",
-  "not_a_student": "不是学生?",
   "not_found_error_from_the_supplied_url": "在Overleaf打开此内容的链接指向找不到的文件。如果某个网站的链接经常出现这种情况,请向他们报告。",
   "not_managed": "未被托管",
   "not_now": "稍后",
@@ -1538,7 +1528,6 @@
   "problem_talking_to_publishing_service": "我们的发布服务出现故障,请在几分钟后再试",
   "problem_with_subscription_contact_us": "您的订购出现了问题。请联系我们以获得更多信息。",
   "proceed_to_paypal": "继续使用 PayPal",
-  "proceeding_to_paypal_takes_you_to_the_paypal_site_to_pay": "继续访问 PayPal 将带您前往 PayPal 网站支付订阅费用。",
   "processing": "处理中",
   "processing_uppercase": "处理中",
   "processing_your_request": "我们正在处理您的请求,请稍候。",
@@ -1882,7 +1871,6 @@
   "something_went_wrong": "出了些问题",
   "something_went_wrong_canceling_your_subscription": "取消订阅时出错。请联系支持人员。",
   "something_went_wrong_loading_pdf_viewer": "加载 PDF 查看器时出错。 这可能是由<0>临时网络问题</0>或<0>过时的网络浏览器</0>等问题引起的。 请按照<1>访问、加载和显示问题的故障排除步骤</1>进行操作。 如果问题仍然存在,请<2>告知我们</2>。",
-  "something_went_wrong_processing_the_request": "处理请求时出错",
   "something_went_wrong_rendering_pdf": "渲染此PDF时出错了。",
   "something_went_wrong_rendering_pdf_expected": "显示此 PDF 时出现问题。 <0>请重新编译</0>",
   "something_went_wrong_server": "与服务器交谈时出错 :(。请再试一次。",
@@ -1972,7 +1960,6 @@
   "store_your_work": "将工作存储在自己的硬件上",
   "stretch_width_to_text": "拉伸宽度适应文本",
   "student": "学生",
-  "student_disclaimer": "教育折扣适用于中学和高等教育机构(学校和大学)的所有学生。 我们可能会与您联系以确认您是否有资格享受折扣。",
   "student_verification_required": "需要学生验证",
   "students": "学生",
   "subject": "主题",
@@ -2007,7 +1994,6 @@
   "switch_compile_mode_for_faster_draft_compilation": "切换编译模式以加快草稿编译速度",
   "switch_to_editor": "切换到编辑器",
   "switch_to_pdf": "切换到 PDF",
-  "switch_to_standard_plan": "切换到标准订阅计划",
   "symbol": "符号",
   "symbol_palette": "数学符号面板",
   "symbol_palette_highlighted": "<0>符号</0> 面板",

+ 0 - 151
services/web/test/unit/src/Subscription/SubscriptionHandler.test.mjs

@@ -82,13 +82,9 @@ describe('SubscriptionHandler', function () {
       promises: {
         getSubscription: sinon.stub().resolves(ctx.activeRecurlySubscription),
         redeemCoupon: sinon.stub().resolves(),
-        createSubscription: sinon
-          .stub()
-          .resolves(ctx.activeRecurlySubscription),
         getBillingInfo: sinon.stub().resolves(),
         getAccountPastDueInvoices: sinon.stub().resolves(),
         attemptInvoiceCollection: sinon.stub().resolves(),
-        listAccountActiveSubscriptions: sinon.stub().resolves([]),
       },
     }
     ctx.RecurlyClient = {
@@ -133,12 +129,6 @@ describe('SubscriptionHandler', function () {
       sendDeferredEmail: sinon.stub(),
     }
 
-    ctx.UserUpdater = {
-      promises: {
-        updateUser: sinon.stub().resolves(),
-      },
-    }
-
     ctx.SplitTestHandler = {
       promises: {
         getAssignmentForUser: sinon.stub().resolves({ variant: 'default' }),
@@ -214,10 +204,6 @@ describe('SubscriptionHandler', function () {
       })
     )
 
-    vi.doMock('../../../../app/src/Features/User/UserUpdater', () => ({
-      default: ctx.UserUpdater,
-    }))
-
     vi.doMock(
       '../../../../app/src/Features/SplitTests/SplitTestHandler',
       () => ({
@@ -252,94 +238,6 @@ describe('SubscriptionHandler', function () {
     ctx.SubscriptionHandler = (await import(MODULE_PATH)).default
   })
 
-  describe('createSubscription', function () {
-    beforeEach(function (ctx) {
-      ctx.subscriptionDetails = {
-        cvv: '123',
-        number: '12345',
-      }
-      ctx.recurlyTokenIds = { billing: '45555666' }
-    })
-
-    describe('successfully', function () {
-      beforeEach(async function (ctx) {
-        await ctx.SubscriptionHandler.promises.createSubscription(
-          ctx.user,
-          ctx.subscriptionDetails,
-          ctx.recurlyTokenIds
-        )
-      })
-
-      it('should create the subscription with the wrapper', function (ctx) {
-        ctx.RecurlyWrapper.promises.createSubscription
-          .calledWith(ctx.user, ctx.subscriptionDetails, ctx.recurlyTokenIds)
-          .should.equal(true)
-      })
-
-      it('should sync the subscription to the user', function (ctx) {
-        ctx.SubscriptionUpdater.promises.syncSubscription.calledOnce.should.equal(
-          true
-        )
-        ctx.SubscriptionUpdater.promises.syncSubscription.args[0][0].should.deep.equal(
-          ctx.activeRecurlySubscription
-        )
-        ctx.SubscriptionUpdater.promises.syncSubscription.args[0][1].should.deep.equal(
-          ctx.user._id
-        )
-      })
-
-      it('should not set last trial date if not a trial/the trial_started_at is not set', function (ctx) {
-        ctx.UserUpdater.promises.updateUser.should.not.have.been.called
-      })
-    })
-
-    describe('when the subscription is a trial and has a trial_started_at date', function () {
-      beforeEach(async function (ctx) {
-        ctx.activeRecurlySubscription.trial_started_at =
-          '2024-01-01T09:58:35.531+00:00'
-        await ctx.SubscriptionHandler.promises.createSubscription(
-          ctx.user,
-          ctx.subscriptionDetails,
-          ctx.recurlyTokenIds
-        )
-      })
-      it('should set the users lastTrial date', function (ctx) {
-        ctx.UserUpdater.promises.updateUser.should.have.been.calledOnce
-        expect(ctx.UserUpdater.promises.updateUser.args[0][0]).to.deep.equal({
-          _id: ctx.user_id,
-          lastTrial: {
-            $not: {
-              $gt: new Date(ctx.activeRecurlySubscription.trial_started_at),
-            },
-          },
-        })
-        expect(ctx.UserUpdater.promises.updateUser.args[0][1]).to.deep.equal({
-          $set: {
-            lastTrial: new Date(ctx.activeRecurlySubscription.trial_started_at),
-          },
-        })
-      })
-    })
-
-    describe('when there is already a subscription in Recurly', function () {
-      beforeEach(function (ctx) {
-        ctx.RecurlyWrapper.promises.listAccountActiveSubscriptions.resolves([
-          ctx.subscription,
-        ])
-      })
-
-      it('should an error', function (ctx) {
-        expect(
-          ctx.SubscriptionHandler.promises.createSubscription(
-            ctx.user,
-            ctx.subscriptionDetails,
-            ctx.recurlyTokenIds
-          )
-        ).to.be.rejectedWith('user already has subscription in recurly')
-      })
-    })
-  })
-
   describe('updateSubscription', function () {
     beforeEach(function (ctx) {
       ctx.user.id = ctx.activeRecurlySubscription.account.account_code
@@ -1053,53 +951,4 @@ describe('SubscriptionHandler', function () {
       })
     })
   })
-
-  describe('validateNoSubscriptionInRecurly', function () {
-    describe('with a subscription in recurly', function () {
-      beforeEach(async function (ctx) {
-        ctx.RecurlyWrapper.promises.listAccountActiveSubscriptions.resolves([
-          ctx.subscription,
-        ])
-        ctx.isValid =
-          await ctx.SubscriptionHandler.promises.validateNoSubscriptionInRecurly(
-            ctx.user_id
-          )
-      })
-
-      it('should call RecurlyWrapper.promises.listAccountActiveSubscriptions with the user id', function (ctx) {
-        ctx.RecurlyWrapper.promises.listAccountActiveSubscriptions
-          .calledWith(ctx.user_id)
-          .should.equal(true)
-      })
-
-      it('should sync the subscription', function (ctx) {
-        ctx.SubscriptionUpdater.promises.syncSubscription
-          .calledWith(ctx.subscription, ctx.user_id)
-          .should.equal(true)
-      })
-
-      it('should return false', function (ctx) {
-        expect(ctx.isValid).to.equal(false)
-      })
-    })
-
-    describe('with no subscription in recurly', function () {
-      beforeEach(async function (ctx) {
-        ctx.isValid =
-          await ctx.SubscriptionHandler.promises.validateNoSubscriptionInRecurly(
-            ctx.user_id
-          )
-      })
-
-      it('should be rejected and not sync the subscription', function (ctx) {
-        ctx.SubscriptionUpdater.promises.syncSubscription.called.should.equal(
-          false
-        )
-      })
-
-      it('should return true', function (ctx) {
-        expect(ctx.isValid).to.equal(true)
-      })
-    })
-  })
 })