From 3d48e1e027b98d304e93a6ac9ebf814676f11792 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Tue, 30 Mar 2021 16:40:00 +0100 Subject: [PATCH] Merge pull request #3799 from overleaf/tm-past-due-invoice-warning Show warning if users Recurly account has past due invoices. GitOrigin-RevId: 8c501e7e561b201a3a184923c0681d67049464a9 --- .../dashboard/_personal_subscription_recurly.pug | 4 ++++ services/web/frontend/js/main/subscription-dashboard.js | 6 ++++++ services/web/locales/en.json | 1 + 3 files changed, 11 insertions(+) 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 8865252731..06ce9a8d6c 100644 --- a/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug +++ b/services/web/app/views/subscriptions/dashboard/_personal_subscription_recurly.pug @@ -5,6 +5,10 @@ script(type="text/javascript", nonce=scriptNonce). div(ng-controller="RecurlySubscriptionController") div(ng-show="!showCancellation") + if (personalSubscription.recurly.account.has_past_due_invoice && personalSubscription.recurly.account.has_past_due_invoice._ == 'true') + .alert.alert-danger #{translate("account_has_past_due_invoice_change_plan_warning")} + |   + a(href=personalSubscription.recurly.accountManagementLink, target="_blank") #{translate("view_your_invoices")}. case personalSubscription.recurly.state when "active" p !{translate("currently_subscribed_to_plan", {planName: personalSubscription.plan.name}, ['strong'])} diff --git a/services/web/frontend/js/main/subscription-dashboard.js b/services/web/frontend/js/main/subscription-dashboard.js index 0f1b1b5543..3598341cd5 100644 --- a/services/web/frontend/js/main/subscription-dashboard.js +++ b/services/web/frontend/js/main/subscription-dashboard.js @@ -174,6 +174,12 @@ App.controller('GroupMembershipController', function($scope, $modal) { App.controller('RecurlySubscriptionController', function($scope) { const recurlyIsSetup = ensureRecurlyIsSetup() $scope.showChangePlanButton = recurlyIsSetup && !window.subscription.groupPlan + if ( + window.subscription.recurly.account.has_past_due_invoice && + window.subscription.recurly.account.has_past_due_invoice._ === 'true' + ) { + $scope.showChangePlanButton = false + } $scope.recurlyLoadError = !recurlyIsSetup $scope.switchToDefaultView = () => { diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 1b13ecf229..4b13f3c555 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -1010,6 +1010,7 @@ "update_your_billing_details": "Update Your Billing Details", "subscription_canceled_and_terminate_on_x": " Your subscription has been canceled and will terminate on <0>__terminateDate__. No further payments will be taken.", "your_subscription_has_expired": "Your subscription has expired.", + "account_has_past_due_invoice_change_plan_warning": "Your account currently has a past due invoice. You will not be able to change your plan until this is resolved.", "create_new_subscription": "Create New Subscription", "problem_with_subscription_contact_us": "There is a problem with your subscription. Please contact us for more information.", "manage_group": "Manage Group",