diff --git a/services/web/app/src/Features/Subscription/SubscriptionController.js b/services/web/app/src/Features/Subscription/SubscriptionController.js index e7aa941e2d..07c1fb4865 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionController.js +++ b/services/web/app/src/Features/Subscription/SubscriptionController.js @@ -155,6 +155,13 @@ async function userSubscriptionPage(req, res) { AnalyticsManager.recordEventForSession(req.session, 'subscription-page-view') + const assignment = await SplitTestHandler.promises.getAssignment( + req, + 'subscription-cancel-button' + ) + + const cancelButtonNewCopy = assignment && assignment.variant === 'new-copy' + const data = { title: 'your_subscription', plans, @@ -170,6 +177,7 @@ async function userSubscriptionPage(req, res) { v1SubscriptionStatus, currentInstitutionsWithLicence, groupPlanModalOptions, + cancelButtonNewCopy, } res.render('subscriptions/dashboard', data) } diff --git a/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug b/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug index 7566612a94..e8ec18b35b 100644 --- a/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug +++ b/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug @@ -33,7 +33,14 @@ div(ng-controller="RecurlySubscriptionController") |   a(href=personalSubscription.recurly.accountManagementLink, target="_blank").btn.btn-info #{translate("view_your_invoices")} |   - a(href, ng-click="switchToCancellationView()", ng-hide="recurlyLoadError").btn.btn-danger !{translate("cancel_your_subscription")} + unless (cancelButtonNewCopy) + a(href, ng-click="switchToCancellationView()", ng-hide="recurlyLoadError", event-tracking='subscription-page-cancel-button-click', event-tracking-mb="true", event-tracking-trigger="click").btn.btn-danger !{translate("stop_your_subscription")} + if (cancelButtonNewCopy) + p + a(href, ng-click="switchToCancellationView()", ng-hide="recurlyLoadError", event-tracking='subscription-page-cancel-button-click', event-tracking-mb="true", event-tracking-trigger="click").btn.btn-danger !{translate("cancel_your_subscription")} + unless (personalSubscription.recurly.trialEndsAtFormatted && personalSubscription.recurly.trial_ends_at > Date.now()) + p + i !{translate("subscription_will_remain_active_until_end_of_billing_period_x", {terminationDate: personalSubscription.recurly.nextPaymentDueAt}, ['strong'])} when "canceled" p !{translate("currently_subscribed_to_plan", {planName: personalSubscription.plan.name}, ['strong'])} p !{translate("subscription_canceled_and_terminate_on_x", {terminateDate: personalSubscription.recurly.nextPaymentDueAt}, ['strong'])} diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 79682ceab2..dee02ad96b 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -788,7 +788,9 @@ "activate": "Activate", "activating": "Activating", "ill_take_it": "I’ll take it!", - "cancel_your_subscription": "Stop Your Subscription", + "cancel_your_subscription": "Cancel Your Subscription", + "stop_your_subscription": "Stop Your Subscription", + "subscription_will_remain_active_until_end_of_billing_period_x": "Your subscription will remain active until the end of your billing period, <0>__terminationDate__.", "no_thanks_cancel_now": "No thanks, I still want to cancel", "cancel_my_account": "Cancel my subscription", "sure_you_want_to_cancel": "Are you sure you want to cancel?",