Merge pull request #3799 from overleaf/tm-past-due-invoice-warning

Show warning if users Recurly account has past due invoices.

GitOrigin-RevId: 8c501e7e561b201a3a184923c0681d67049464a9
This commit is contained in:
Simon Detheridge 2021-03-30 16:40:00 +01:00 committed by Copybot
parent 467aa16da7
commit 3d48e1e027
3 changed files with 11 additions and 0 deletions

View file

@ -5,6 +5,10 @@ script(type="text/javascript", nonce=scriptNonce).
div(ng-controller="RecurlySubscriptionController") div(ng-controller="RecurlySubscriptionController")
div(ng-show="!showCancellation") 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 case personalSubscription.recurly.state
when "active" when "active"
p !{translate("currently_subscribed_to_plan", {planName: personalSubscription.plan.name}, ['strong'])} p !{translate("currently_subscribed_to_plan", {planName: personalSubscription.plan.name}, ['strong'])}

View file

@ -174,6 +174,12 @@ App.controller('GroupMembershipController', function($scope, $modal) {
App.controller('RecurlySubscriptionController', function($scope) { App.controller('RecurlySubscriptionController', function($scope) {
const recurlyIsSetup = ensureRecurlyIsSetup() const recurlyIsSetup = ensureRecurlyIsSetup()
$scope.showChangePlanButton = recurlyIsSetup && !window.subscription.groupPlan $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.recurlyLoadError = !recurlyIsSetup
$scope.switchToDefaultView = () => { $scope.switchToDefaultView = () => {

View file

@ -1010,6 +1010,7 @@
"update_your_billing_details": "Update Your Billing Details", "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__</0>. No further payments will be taken.", "subscription_canceled_and_terminate_on_x": " Your subscription has been canceled and will terminate on <0>__terminateDate__</0>. No further payments will be taken.",
"your_subscription_has_expired": "Your subscription has expired.", "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", "create_new_subscription": "Create New Subscription",
"problem_with_subscription_contact_us": "There is a problem with your subscription. Please contact us for more information.", "problem_with_subscription_contact_us": "There is a problem with your subscription. Please contact us for more information.",
"manage_group": "Manage Group", "manage_group": "Manage Group",