From d64ba5d2bebfa9c601f597f07f0df0eae32efaeb Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Tue, 7 Aug 2018 19:07:22 +0530 Subject: [PATCH] billing: Update the charged amount when user changes plan in upgrade page. --- templates/zilencer/upgrade.html | 19 +++++++++++++------ zerver/tests/test_templates.py | 2 ++ zilencer/views.py | 3 +++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/templates/zilencer/upgrade.html b/templates/zilencer/upgrade.html index 3b44eed111..f23809cc1e 100644 --- a/templates/zilencer/upgrade.html +++ b/templates/zilencer/upgrade.html @@ -31,26 +31,26 @@

{{ _("Payment schedule") }}

-

You’ll initially be charged XXX for {{ seat_count }} users. You’ll receive prorated charges and credits as users are added, deactivated, or become inactive.

+

You’ll initially be charged ${{ cloud_annual_price * seat_count }} for {{ seat_count }} users. You’ll receive prorated charges and credits as users are added, deactivated, or become inactive.

+

We can also bill by invoice for annual contracts over $2,000. Contact support@zulipchat.com to pay by invoice or for any other billing questions.

diff --git a/zerver/tests/test_templates.py b/zerver/tests/test_templates.py index f2b6725e76..4e5d7e80a9 100644 --- a/zerver/tests/test_templates.py +++ b/zerver/tests/test_templates.py @@ -198,6 +198,8 @@ class TemplateTestCase(ZulipTestCase): "login_time": "9:33am NewYork, NewYork", }, api_uri_context={}, + cloud_annual_price=80, + seat_count=8, ) context.update(kwargs) diff --git a/zilencer/views.py b/zilencer/views.py index 108d36dbfa..dd7fb6fd1f 100644 --- a/zilencer/views.py +++ b/zilencer/views.py @@ -213,6 +213,9 @@ def initial_upgrade(request: HttpRequest) -> HttpResponse: 'nickname_monthly': Plan.CLOUD_MONTHLY, 'nickname_annual': Plan.CLOUD_ANNUAL, 'error_message': error_message, + 'cloud_monthly_price': 8, + 'cloud_annual_price': 80, + 'cloud_annual_price_per_month': 6.67, } # type: Dict[str, Any] response = render(request, 'zilencer/upgrade.html', context=context) response['error_description'] = error_description