From 0ce072201b11fe038c1688ce31d6b9c4ce4d1ad3 Mon Sep 17 00:00:00 2001 From: Alex Gibson Date: Thu, 10 Aug 2023 17:50:56 +0100 Subject: [PATCH] Use currency formatting for VPN display prices (Fixes #13476) --- bedrock/products/templatetags/misc.py | 10 +- bedrock/products/tests/test_helper_misc.py | 582 ++++++++++++++++----- bedrock/settings/base.py | 165 +++--- 3 files changed, 562 insertions(+), 195 deletions(-) diff --git a/bedrock/products/templatetags/misc.py b/bedrock/products/templatetags/misc.py index 6cfaafb4f2d..5ab16f30659 100644 --- a/bedrock/products/templatetags/misc.py +++ b/bedrock/products/templatetags/misc.py @@ -164,7 +164,10 @@ def vpn_monthly_price(ctx, plan=VPN_12_MONTH_PLAN, country_code=None, lang=None, available_plans = _vpn_get_available_plans(country_code, lang, bundle_relay) selected_plan = available_plans.get(plan, VPN_12_MONTH_PLAN) - amount = selected_plan.get("price") + price = float(selected_plan.get("price")) + currency = selected_plan.get("currency") + currency_locale = lang.replace("-", "_") + amount = format_currency(price, currency, locale=currency_locale) if country_code in TAX_NOT_INCLUDED: price = ftl("vpn-shared-pricing-monthly-plus-tax", fallback="vpn-shared-pricing-monthly", amount=amount, ftl_files=FTL_FILES) @@ -193,7 +196,10 @@ def vpn_total_price(ctx, country_code=None, lang=None, bundle_relay=False): available_plans = _vpn_get_available_plans(country_code, lang, bundle_relay) selected_plan = available_plans.get(VPN_12_MONTH_PLAN) - amount = selected_plan.get("total") + price = float(selected_plan.get("total")) + currency = selected_plan.get("currency") + currency_locale = lang.replace("-", "_") + amount = format_currency(price, currency, locale=currency_locale) if country_code in TAX_NOT_INCLUDED: price = ftl("vpn-shared-pricing-total-plus-tax", fallback="vpn-shared-pricing-total", amount=amount, ftl_files=FTL_FILES) diff --git a/bedrock/products/tests/test_helper_misc.py b/bedrock/products/tests/test_helper_misc.py index 3f15ccc1c98..3bc559c9fbd 100644 --- a/bedrock/products/tests/test_helper_misc.py +++ b/bedrock/products/tests/test_helper_misc.py @@ -17,102 +17,374 @@ TEST_VPN_PLAN_ID_MATRIX = { "chf": { # Swiss franc "de": { # German - "12-month": {"id": "price_1J5JssJNcmPzuWtR616BH4aU", "price": "CHF 5.99", "total": "CHF 71.88", "saving": 45}, - "monthly": {"id": "price_1J5Ju3JNcmPzuWtR3GpNYSWj", "price": "CHF 10.99", "total": None, "saving": None}, + "12-month": { + "id": "price_1J5JssJNcmPzuWtR616BH4aU", + "price": "5.99", + "total": "71.88", + "currency": "CHF", + "saving": 45, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "60.00", "price": "71.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1J5Ju3JNcmPzuWtR3GpNYSWj", + "price": "10.99", + "total": None, + "currency": "CHF", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "0", "price": "10.99", "period": "monthly"}, + }, }, "fr": { # French - "12-month": {"id": "price_1J5JunJNcmPzuWtRo9dLxn6M", "price": "CHF 5.99", "total": "CHF 71.88", "saving": 45}, - "monthly": {"id": "price_1J5JvjJNcmPzuWtR3wwy1dcR", "price": "CHF 10.99", "total": None, "saving": None}, + "12-month": { + "id": "price_1J5JunJNcmPzuWtRo9dLxn6M", + "price": "5.99", + "total": "71.88", + "currency": "CHF", + "saving": 45, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "60.00", "price": "71.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1J5JvjJNcmPzuWtR3wwy1dcR", + "price": "10.99", + "currency": "CHF", + "total": None, + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "0", "price": "10.99", "period": "monthly"}, + }, }, "it": { # Italian - "12-month": {"id": "price_1J5JwWJNcmPzuWtRgrx5fjOc", "price": "CHF 5.99", "total": "CHF 71.88", "saving": 45}, - "monthly": {"id": "price_1J5JxGJNcmPzuWtRrp5e1SUB", "price": "CHF 10.99", "total": None, "saving": None}, + "12-month": { + "id": "price_1J5JwWJNcmPzuWtRgrx5fjOc", + "price": "5.99", + "total": "71.88", + "currency": "CHF", + "saving": 45, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "60.00", "price": "71.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1J5JxGJNcmPzuWtRrp5e1SUB", + "price": "10.99", + "total": None, + "currency": "CHF", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "0", "price": "10.99", "period": "monthly"}, + }, }, }, "czk": { # Czech koruna "cs": { # Czech - "12-month": {"id": "price_1N7PDwJNcmPzuWtR1IxSkZ0c", "price": "119 Kč", "total": "1,428 Kč", "saving": 50}, - "monthly": {"id": "price_1N7PESJNcmPzuWtRTgmv8Ve4", "price": "237 Kč", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7PDwJNcmPzuWtR1IxSkZ0c", + "price": "119", + "total": "1428", + "currency": "CZK", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CZK", "discount": "1416", "price": "1428", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PESJNcmPzuWtRTgmv8Ve4", + "price": "237", + "total": None, + "currency": "CZK", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CZK", "discount": "0", "price": "237", "period": "monthly"}, + }, }, }, "dkk": { # Danish krone "da": { # Dansk - "12-month": {"id": "price_1N7PCQJNcmPzuWtRNqtksScA", "price": "kr. 37", "total": "kr. 444", "saving": 50}, - "monthly": {"id": "price_1N7PCsJNcmPzuWtRXIMBFQbq", "price": "kr. 75", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7PCQJNcmPzuWtRNqtksScA", + "price": "37", + "total": "444", + "currency": "DKK", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "DKK", "discount": "456", "price": "444", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PCsJNcmPzuWtRXIMBFQbq", + "price": "75", + "total": None, + "currency": "DKK", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "DKK", "discount": "0", "price": "75", "period": "monthly"}, + }, }, }, "euro": { # Euro "bg": { # Bulgarian - "12-month": {"id": "price_1N7PGEJNcmPzuWtRzTe85nzw", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1N7PHRJNcmPzuWtRjZ8D8kwx", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7PGEJNcmPzuWtRzTe85nzw", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PHRJNcmPzuWtRjZ8D8kwx", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "de": { # German - "12-month": {"id": "price_1IgwblJNcmPzuWtRynC7dqQa", "price": "4,99 €", "total": "59,88 €", "saving": 50}, + "12-month": { + "id": "price_1IgwblJNcmPzuWtRynC7dqQa", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, "monthly": { "id": "price_1IgwZVJNcmPzuWtRg9Wssh2y", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, }, "el": { # Greek - "12-month": {"id": "price_1N7PPyJNcmPzuWtRkUbirJmB", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1N7PQIJNcmPzuWtR2BQdQbtL", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7PPyJNcmPzuWtRkUbirJmB", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PQIJNcmPzuWtR2BQdQbtL", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "en": { # English - "12-month": {"id": "price_1JcdvBJNcmPzuWtROLbEH9d2", "price": "4.99 €", "total": "59.88 €", "saving": 50}, - "monthly": {"id": "price_1JcdsSJNcmPzuWtRGF9Y5TMJ", "price": "9.99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1JcdvBJNcmPzuWtROLbEH9d2", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1JcdsSJNcmPzuWtRGF9Y5TMJ", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "es": { # Spanish - "12-month": {"id": "price_1J5JCdJNcmPzuWtRrvQMFLlP", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1J5JDgJNcmPzuWtRqQtIbktk", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1J5JCdJNcmPzuWtRrvQMFLlP", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1J5JDgJNcmPzuWtRqQtIbktk", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "fr": { # French - "12-month": {"id": "price_1IgnlcJNcmPzuWtRjrNa39W4", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1IgowHJNcmPzuWtRzD7SgAYb", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1IgnlcJNcmPzuWtRjrNa39W4", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1IgowHJNcmPzuWtRzD7SgAYb", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "hu": { # Hungarian - "12-month": {"id": "price_1N7PF1JNcmPzuWtRujxNI9yh", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1N7PFbJNcmPzuWtRlVNtHvgG", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7PF1JNcmPzuWtRujxNI9yh", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PFbJNcmPzuWtRlVNtHvgG", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "it": { # Italian - "12-month": {"id": "price_1J4owvJNcmPzuWtRomVhWQFq", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1J5J6iJNcmPzuWtRK5zfoguV", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1J4owvJNcmPzuWtRomVhWQFq", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1J5J6iJNcmPzuWtRK5zfoguV", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "nl": { # Dutch - "12-month": {"id": "price_1J5JRGJNcmPzuWtRXwXA84cm", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1J5JSkJNcmPzuWtR54LPH2zi", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1J5JRGJNcmPzuWtRXwXA84cm", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1J5JSkJNcmPzuWtR54LPH2zi", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "pt": { # Portuguese - "12-month": {"id": "price_1N7PBOJNcmPzuWtRykt8Uyzm", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1N7PBsJNcmPzuWtRzS5kTc5B", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7PBOJNcmPzuWtRykt8Uyzm", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PBsJNcmPzuWtRzS5kTc5B", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, + }, + "ro": { # Romanian + "12-month": { + "id": "price_1N7PADJNcmPzuWtRxHjlrDiy", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PAmJNcmPzuWtR1zOoPIao", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "sk": { # Slovak - "12-month": {"id": "price_1N7PKUJNcmPzuWtRrnyAM0wd", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1N7PKyJNcmPzuWtROTKgdgW0", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7PKUJNcmPzuWtRrnyAM0wd", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PKyJNcmPzuWtROTKgdgW0", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, "sl": { # Slovenian - "12-month": {"id": "price_1N7PMcJNcmPzuWtR8TWsjoHe", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1N7PN6JNcmPzuWtRpN8HAr7L", "price": "9,99 €", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7PMcJNcmPzuWtR8TWsjoHe", + "price": "4.99", + "total": "59.88", + "currency": "EUR", + "saving": 50, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7PN6JNcmPzuWtRpN8HAr7L", + "price": "9.99", + "total": None, + "currency": "EUR", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, + }, }, }, "pln": { # Polish złoty "en": { # English - "12-month": {"id": "price_1N7P8TJNcmPzuWtRI7pI29bO", "price": "22 zł", "total": "264 zł", "saving": 48}, - "monthly": {"id": "price_1N7P98JNcmPzuWtRbUaI24OH", "price": "45 zł", "total": None, "saving": None}, + "12-month": { + "id": "price_1N7P8TJNcmPzuWtRI7pI29bO", + "price": "22", + "total": "264", + "currency": "PLN", + "saving": 48, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "PLN", "discount": "276", "price": "264", "period": "yearly"}, + }, + "monthly": { + "id": "price_1N7P98JNcmPzuWtRbUaI24OH", + "price": "45", + "total": None, + "currency": "PLN", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "PLN", "discount": "0", "price": "45", "period": "monthly"}, + }, }, }, "usd": { # US dollar "en": { # English "12-month": { "id": "price_1Iw85dJNcmPzuWtRyhMDdtM7", - "price": "US$4.99", - "total": "US$59.88", + "price": "4.99", + "total": "59.88", + "currency": "USD", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "USD", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, - "monthly": {"id": "price_1Iw7qSJNcmPzuWtRMUZpOwLm", "price": "US$9.99", "total": None, "saving": None}, + "monthly": { + "id": "price_1Iw7qSJNcmPzuWtRMUZpOwLm", + "price": "9.99", + "total": None, + "currency": "USD", + "saving": None, + "analytics": {"brand": "vpn", "plan": "vpn", "currency": "USD", "discount": "0", "price": "9.99", "period": "monthly"}, + }, } }, } @@ -215,7 +487,7 @@ TEST_VPN_RELAY_BUNDLE_PLAN_ID_MATRIX = { "usd": { "en": { - "12-month": {"id": "price_1LwoSDJNcmPzuWtR6wPJZeoh", "price": "US$6.99", "total": "US$83.88", "saving": 50}, + "12-month": {"id": "price_1LwoSDJNcmPzuWtR6wPJZeoh", "price": "6.99", "total": "83.88", "currency": "USD", "saving": 50}, } }, } @@ -267,24 +539,6 @@ def _render( def test_vpn_subscribe_link_variable_12_month(self): """Should return expected markup for variable 12-month plan link""" - markup = self._render( - plan="12-month", - country_code="DE", - lang="de", - optional_parameters={"utm_campaign": "vpn-product-page"}, - optional_attributes={"data-cta-text": "Get Mozilla VPN yearly", "data-cta-type": "fxa-vpn", "data-cta-position": "primary"}, - ) - expected = ( - 'Get Mozilla VPN' - ) - self.assertEqual(markup, expected) - - def test_vpn_subscribe_link_variable_12_month_with_analytics(self): - """Should return expected markup for variable 12-month plan link with analytics""" markup = self._render( plan="12-month", country_code="US", @@ -302,7 +556,7 @@ def test_vpn_subscribe_link_variable_12_month_with_analytics(self): ) self.assertEqual(markup, expected) - def test_vpn_subscribe_link_variable_12_month_no_options_with_analytics(self): + def test_vpn_subscribe_link_variable_12_month_no_options(self): """Should return expected markup for variable 12-month plan link with analytics""" markup = self._render( plan="12-month", @@ -331,27 +585,9 @@ def test_vpn_subscribe_link_variable_monthly(self): 'Get Mozilla VPN' - ) - self.assertEqual(markup, expected) - - def test_vpn_subscribe_link_variable_monthly_with_analytics(self): - """Should return expected markup for variable monthly plan link including analytics""" - markup = self._render( - plan="monthly", - country_code="DE", - lang="de", - optional_parameters={"utm_campaign": "vpn-product-page"}, - optional_attributes={"data-cta-text": "Get Mozilla VPN monthly", "data-cta-type": "fxa-vpn", "data-cta-position": "primary"}, - ) - expected = ( - 'Get Mozilla VPN" + "data-cta-type=\"fxa-vpn\" data-cta-position=\"primary\" data-ga-item=\"{'id' : 'price_1Iw7qSJNcmPzuWtRMUZpOwLm','brand' : 'vpn'," + "'plan' : 'vpn','period' : 'monthly','price' : '9.99','discount' : '0','currency' : 'USD'}\">Get Mozilla VPN" ) self.assertEqual(markup, expected) @@ -997,100 +1233,154 @@ def _render(self, plan, country_code, lang): req.locale = "en-US" return render(f"{{{{ vpn_monthly_price('{plan}', '{country_code}', '{lang}') }}}}", {"request": req}) - def test_vpn_monthly_price_usd(self): + def test_vpn_monthly_price_usd_en_us(self): """Should return expected markup""" markup = self._render(plan="monthly", country_code="US", lang="en-US") - expected = 'US$9.99/month + tax' + expected = '$9.99/month + tax' self.assertEqual(markup, expected) - def test_vpn_monthly_price_usd_ca(self): + def test_vpn_monthly_price_usd_en_ca(self): """Should return expected markup""" - markup = self._render(plan="monthly", country_code="CA", lang="en-US") + markup = self._render(plan="monthly", country_code="CA", lang="en-CA") expected = 'US$9.99/month + tax' self.assertEqual(markup, expected) - def test_vpn_monthly_price_euro(self): + def test_vpn_monthly_price_euro_en_us(self): """Should return expected markup""" markup = self._render(plan="monthly", country_code="DE", lang="en-US") - expected = '9,99 €/month' + expected = '€9.99/month' + self.assertEqual(markup, expected) + + def test_vpn_monthly_price_euro_de(self): + """Should return expected markup""" + markup = self._render(plan="monthly", country_code="DE", lang="de") + expected = '9,99\xa0€/month' self.assertEqual(markup, expected) def test_vpn_monthly_price_euro_fi(self): """Should return expected markup""" markup = self._render(plan="monthly", country_code="FI", lang="en-US") - expected = '9.99 €/month' + expected = '€9.99/month' self.assertEqual(markup, expected) - def test_vpn_monthly_price_chf(self): + def test_vpn_monthly_price_chf_en_us(self): """Should return expected markup""" markup = self._render(plan="monthly", country_code="CH", lang="en-US") - expected = 'CHF 10.99/month' + expected = 'CHF10.99/month' + self.assertEqual(markup, expected) + + def test_vpn_monthly_price_chf_de(self): + """Should return expected markup""" + markup = self._render(plan="monthly", country_code="CH", lang="de") + expected = '10,99\xa0CHF/month' self.assertEqual(markup, expected) - def test_vpn_12_month_price_usd(self): + def test_vpn_12_month_price_usd_en_us(self): """Should return expected markup""" markup = self._render(plan="12-month", country_code="US", lang="en-US") - expected = 'US$4.99/month + tax' + expected = '$4.99/month + tax' self.assertEqual(markup, expected) - def test_vpn_12_month_price_usd_ca(self): + def test_vpn_12_month_price_usd_en_ca(self): """Should return expected markup""" - markup = self._render(plan="12-month", country_code="CA", lang="en-US") + markup = self._render(plan="12-month", country_code="CA", lang="en-CA") expected = 'US$4.99/month + tax' self.assertEqual(markup, expected) - def test_vpn_12_month_price_euro(self): + def test_vpn_12_month_price_euro_en_us(self): """Should return expected markup""" markup = self._render(plan="12-month", country_code="DE", lang="en-US") - expected = '4,99 €/month' + expected = '€4.99/month' + self.assertEqual(markup, expected) + + def test_vpn_12_month_price_euro_de(self): + """Should return expected markup""" + markup = self._render(plan="12-month", country_code="DE", lang="de") + expected = '4,99\xa0€/month' self.assertEqual(markup, expected) def test_vpn_12_month_price_euro_fi(self): """Should return expected markup""" - markup = self._render(plan="12-month", country_code="FI", lang="en-US") - expected = '4.99 €/month' + markup = self._render(plan="12-month", country_code="FI", lang="fi") + expected = '4,99\xa0€/month' self.assertEqual(markup, expected) - def test_vpn_12_month_price_chf(self): + def test_vpn_12_month_price_chf_en_us(self): """Should return expected markup""" markup = self._render(plan="12-month", country_code="CH", lang="en-US") - expected = 'CHF 5.99/month' + expected = 'CHF5.99/month' self.assertEqual(markup, expected) - def test_vpn_monthly_price_czk(self): + def test_vpn_12_month_price_chf_de(self): + """Should return expected markup""" + markup = self._render(plan="12-month", country_code="CH", lang="de") + expected = '5,99\xa0CHF/month' + self.assertEqual(markup, expected) + + def test_vpn_monthly_price_czk_en_us(self): """Should return expected markup""" markup = self._render(plan="monthly", country_code="CZ", lang="en-US") - expected = '237 Kč/month' + expected = 'CZK237.00/month' + self.assertEqual(markup, expected) + + def test_vpn_monthly_price_czk_cs(self): + """Should return expected markup""" + markup = self._render(plan="monthly", country_code="CZ", lang="cs") + expected = '237,00\xa0Kč/month' self.assertEqual(markup, expected) - def test_vpn_12_month_price_czk(self): + def test_vpn_12_month_price_czk_en_us(self): """Should return expected markup""" markup = self._render(plan="12-month", country_code="CZ", lang="en-US") - expected = '119 Kč/month' + expected = 'CZK119.00/month' + self.assertEqual(markup, expected) + + def test_vpn_12_month_price_czk_cs(self): + """Should return expected markup""" + markup = self._render(plan="12-month", country_code="CZ", lang="cs") + expected = '119,00\xa0Kč/month' self.assertEqual(markup, expected) - def test_vpn_monthly_price_dkk(self): + def test_vpn_monthly_price_dkk_en_us(self): """Should return expected markup""" markup = self._render(plan="monthly", country_code="DK", lang="en-US") - expected = 'kr. 75/month' + expected = 'DKK75.00/month' self.assertEqual(markup, expected) - def test_vpn_12_month_price_dkk(self): + def test_vpn_monthly_price_dkk_da(self): + """Should return expected markup""" + markup = self._render(plan="monthly", country_code="DK", lang="da") + expected = '75,00\xa0kr./month' + self.assertEqual(markup, expected) + + def test_vpn_12_month_price_dkk_en_us(self): """Should return expected markup""" markup = self._render(plan="12-month", country_code="DK", lang="en-US") - expected = 'kr. 37/month' + expected = 'DKK37.00/month' + self.assertEqual(markup, expected) + + def test_vpn_12_month_price_dkk_da(self): + """Should return expected markup""" + markup = self._render(plan="12-month", country_code="DK", lang="da") + expected = '37,00\xa0kr./month' self.assertEqual(markup, expected) - def test_vpn_monthly_price_pln(self): + def test_vpn_monthly_price_pln_en_us(self): """Should return expected markup""" markup = self._render(plan="monthly", country_code="PL", lang="en-US") - expected = '45 zł/month' + expected = 'PLN45.00/month' + self.assertEqual(markup, expected) + + def test_vpn_monthly_price_pln_pl(self): + """Should return expected markup""" + markup = self._render(plan="monthly", country_code="PL", lang="pl") + expected = '45,00\xa0zł/month' self.assertEqual(markup, expected) - def test_vpn_12_month_price_pln(self): + def test_vpn_12_month_price_pln_pl(self): """Should return expected markup""" - markup = self._render(plan="12-month", country_code="PL", lang="en-US") - expected = '22 zł/month' + markup = self._render(plan="12-month", country_code="PL", lang="pl") + expected = '22,00\xa0zł/month' self.assertEqual(markup, expected) @@ -1106,63 +1396,93 @@ def _render(self, country_code, lang, bundle_relay=False): req.locale = "en-US" return render(f"{{{{ vpn_total_price('{country_code}', '{lang}', {bundle_relay}) }}}}", {"request": req}) - def test_vpn_12_month_total_price_usd(self): + def test_vpn_12_month_total_price_usd_en_us(self): """Should return expected markup""" markup = self._render(country_code="US", lang="en-US") - expected = "US$59.88 total + tax" + expected = "$59.88 total + tax" self.assertEqual(markup, expected) - def test_vpn_12_month_total_price_usd_ca(self): + def test_vpn_12_month_total_price_usd_en_cs(self): """Should return expected markup""" - markup = self._render(country_code="CA", lang="en-US") + markup = self._render(country_code="CA", lang="en-CA") expected = "US$59.88 total + tax" self.assertEqual(markup, expected) - def test_vpn_12_month_total_price_euro(self): + def test_vpn_12_month_total_price_euro_en_us(self): """Should return expected markup""" markup = self._render(country_code="DE", lang="en-US") - expected = "59,88 € total" + expected = "€59.88 total" + self.assertEqual(markup, expected) + + def test_vpn_12_month_total_price_euro_de(self): + """Should return expected markup""" + markup = self._render(country_code="DE", lang="de") + expected = "59,88\xa0€ total" self.assertEqual(markup, expected) def test_vpn_12_month_total_price_euro_fi(self): """Should return expected markup""" - markup = self._render(country_code="FI", lang="en-US") - expected = "59.88 € total" + markup = self._render(country_code="FI", lang="fi") + expected = "59,88\xa0€ total" self.assertEqual(markup, expected) - def test_vpn_12_month_total_price_chf(self): + def test_vpn_12_month_total_price_chf_en_us(self): """Should return expected markup""" markup = self._render(country_code="CH", lang="en-US") - expected = "CHF 71.88 total" + expected = "CHF71.88 total" + self.assertEqual(markup, expected) + + def test_vpn_12_month_total_price_chf_de(self): + """Should return expected markup""" + markup = self._render(country_code="CH", lang="de") + expected = "71,88\xa0CHF total" self.assertEqual(markup, expected) - def test_vpn_12_month_total_price_czk(self): + def test_vpn_12_month_total_price_czk_en_us(self): """Should return expected markup""" markup = self._render(country_code="CZ", lang="en-US") - expected = "1,428 Kč total" + expected = "CZK1,428.00 total" self.assertEqual(markup, expected) - def test_vpn_12_month_total_price_dkk(self): + def test_vpn_12_month_total_price_czk_cs(self): + """Should return expected markup""" + markup = self._render(country_code="CZ", lang="cs") + expected = "1\xa0428,00\xa0Kč total" + self.assertEqual(markup, expected) + + def test_vpn_12_month_total_price_dkk_en_us(self): """Should return expected markup""" markup = self._render(country_code="DK", lang="en-US") - expected = "kr. 444 total" + expected = "DKK444.00 total" self.assertEqual(markup, expected) - def test_vpn_12_month_total_price_pln(self): + def test_vpn_12_month_total_price_dkk_da(self): + """Should return expected markup""" + markup = self._render(country_code="DK", lang="da") + expected = "444,00\xa0kr. total" + self.assertEqual(markup, expected) + + def test_vpn_12_month_total_price_pln_en_us(self): """Should return expected markup""" markup = self._render(country_code="PL", lang="en-US") - expected = "264 zł total" + expected = "PLN264.00 total" self.assertEqual(markup, expected) - def test_vpn_relay_bundle_12_month_total_price_usd(self): + def test_vpn_12_month_total_price_pln_pl(self): + """Should return expected markup""" + markup = self._render(country_code="PL", lang="pl") + expected = "264,00\xa0zł total" + self.assertEqual(markup, expected) + + def test_vpn_relay_bundle_12_month_total_price_usd_en_us(self): """Should return expected markup""" markup = self._render(country_code="US", lang="en-US", bundle_relay=True) - expected = "US$83.88 total + tax" + expected = "$83.88 total + tax" self.assertEqual(markup, expected) - def test_vpn_relay_bundle_12_month_total_price_ca(self): + def test_vpn_relay_bundle_12_month_total_price_usd_en_ca(self): """Should return expected markup""" - markup = self._render(country_code="CA", lang="en-US", bundle_relay=True) + markup = self._render(country_code="CA", lang="en-CA", bundle_relay=True) expected = "US$83.88 total + tax" self.assertEqual(markup, expected) diff --git a/bedrock/settings/base.py b/bedrock/settings/base.py index eefb4697f9e..9741ff44a7b 100644 --- a/bedrock/settings/base.py +++ b/bedrock/settings/base.py @@ -1194,15 +1194,17 @@ def before_send(event, hint): "de": { # German "12-month": { "id": "price_1J4sAUKb9q6OnNsLfYDKbpdY" if DEV else "price_1J5JssJNcmPzuWtR616BH4aU", - "price": "CHF 5.99", - "total": "CHF 71.88", + "price": "5.99", + "total": "71.88", + "currency": "CHF", "saving": 45, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "60.00", "price": "71.88", "period": "yearly"}, }, "monthly": { "id": "price_1J4sC2Kb9q6OnNsLIgz3DDu8" if DEV else "price_1J5Ju3JNcmPzuWtR3GpNYSWj", - "price": "CHF 10.99", + "price": "10.99", "total": None, + "currency": "CHF", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "0", "price": "10.99", "period": "monthly"}, }, @@ -1210,14 +1212,16 @@ def before_send(event, hint): "fr": { # French "12-month": { "id": "price_1J4sM2Kb9q6OnNsLsGLZwTP9" if DEV else "price_1J5JunJNcmPzuWtRo9dLxn6M", - "price": "CHF 5.99", - "total": "CHF 71.88", + "price": "5.99", + "total": "71.88", + "currency": "CHF", "saving": 45, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "60.00", "price": "71.88", "period": "yearly"}, }, "monthly": { "id": "price_1J4sNGKb9q6OnNsLl3OEuKqT" if DEV else "price_1J5JvjJNcmPzuWtR3wwy1dcR", - "price": "CHF 10.99", + "price": "10.99", + "currency": "CHF", "total": None, "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "0", "price": "10.99", "period": "monthly"}, @@ -1226,15 +1230,17 @@ def before_send(event, hint): "it": { # Italian "12-month": { "id": "price_1J4sWMKb9q6OnNsLkrTo2uUW" if DEV else "price_1J5JwWJNcmPzuWtRgrx5fjOc", - "price": "CHF 5.99", - "total": "CHF 71.88", + "price": "5.99", + "total": "71.88", + "currency": "CHF", "saving": 45, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "60.00", "price": "71.88", "period": "yearly"}, }, "monthly": { "id": "price_1J4sXWKb9q6OnNsLVoGiXcW5" if DEV else "price_1J5JxGJNcmPzuWtRrp5e1SUB", - "price": "CHF 10.99", + "price": "10.99", "total": None, + "currency": "CHF", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CHF", "discount": "0", "price": "10.99", "period": "monthly"}, }, @@ -1244,15 +1250,17 @@ def before_send(event, hint): "cs": { # Czech "12-month": { "id": "price_1N7ObPKb9q6OnNsLf9okHbUl" if DEV else "price_1N7PDwJNcmPzuWtR1IxSkZ0c", - "price": "119 Kč", - "total": "1,428 Kč", + "price": "119", + "total": "1428", + "currency": "CZK", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CZK", "discount": "1416", "price": "1428", "period": "yearly"}, }, "monthly": { "id": "price_1N7Oc2Kb9q6OnNsLkYPFVHtx" if DEV else "price_1N7PESJNcmPzuWtRTgmv8Ve4", - "price": "237 Kč", + "price": "237", "total": None, + "currency": "CZK", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "CZK", "discount": "0", "price": "237", "period": "monthly"}, }, @@ -1262,15 +1270,17 @@ def before_send(event, hint): "da": { # Dansk "12-month": { "id": "price_1N7Oa1Kb9q6OnNsLh9F1hDhi" if DEV else "price_1N7PCQJNcmPzuWtRNqtksScA", - "price": "kr. 37", - "total": "kr. 444", + "price": "37", + "total": "444", + "currency": "DKK", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "DKK", "discount": "456", "price": "444", "period": "yearly"}, }, "monthly": { "id": "price_1N7OapKb9q6OnNsLTvIbY6DY" if DEV else "price_1N7PCsJNcmPzuWtRXIMBFQbq", - "price": "kr. 75", + "price": "75", "total": None, + "currency": "DKK", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "DKK", "discount": "0", "price": "75", "period": "monthly"}, }, @@ -1280,15 +1290,17 @@ def before_send(event, hint): "bg": { # Bulgarian "12-month": { "id": "price_1N7OdmKb9q6OnNsLO0Rf6LUt" if DEV else "price_1N7PGEJNcmPzuWtRzTe85nzw", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N7OeJKb9q6OnNsLvGDxhcaj" if DEV else "price_1N7PHRJNcmPzuWtRjZ8D8kwx", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1296,15 +1308,17 @@ def before_send(event, hint): "de": { # German "12-month": { "id": "price_1IXw5oKb9q6OnNsLPMkWOid7" if DEV else "price_1IgwblJNcmPzuWtRynC7dqQa", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N9CInKb9q6OnNsLQYotCVpd" if DEV else "price_1IgwZVJNcmPzuWtRg9Wssh2y", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1312,15 +1326,17 @@ def before_send(event, hint): "el": { # Greek "12-month": { "id": "price_1N7Or1Kb9q6OnNsLhHrEcbwd" if DEV else "price_1N7PPyJNcmPzuWtRkUbirJmB", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N7OrgKb9q6OnNsLk5xS9DYr" if DEV else "price_1N7PQIJNcmPzuWtR2BQdQbtL", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1328,15 +1344,17 @@ def before_send(event, hint): "en": { # English "12-month": { "id": "price_1JcuArKb9q6OnNsLXAnkCSUE" if DEV else "price_1JcdvBJNcmPzuWtROLbEH9d2", - "price": "4.99 €", - "total": "59.88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1Jcu7uKb9q6OnNsLG4JAAXuw" if DEV else "price_1JcdsSJNcmPzuWtRGF9Y5TMJ", - "price": "9.99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1344,15 +1362,17 @@ def before_send(event, hint): "es": { # Spanish "12-month": { "id": "price_1J4pE7Kb9q6OnNsLnvvyRClI" if DEV else "price_1J5JCdJNcmPzuWtRrvQMFLlP", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1J4pFSKb9q6OnNsLEyiFLbvB" if DEV else "price_1J5JDgJNcmPzuWtRqQtIbktk", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1360,15 +1380,17 @@ def before_send(event, hint): "fr": { # French "12-month": { "id": "price_1N9CFcKb9q6OnNsL1r7W4EiX" if DEV else "price_1IgnlcJNcmPzuWtRjrNa39W4", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N9CHBKb9q6OnNsLlYDTJ3px" if DEV else "price_1IgowHJNcmPzuWtRzD7SgAYb", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1376,15 +1398,17 @@ def before_send(event, hint): "hu": { # Hungarian "12-month": { "id": "price_1N7OcfKb9q6OnNsLuXLBVp8T" if DEV else "price_1N7PF1JNcmPzuWtRujxNI9yh", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N7OdBKb9q6OnNsLJENr3u8W" if DEV else "price_1N7PFbJNcmPzuWtRlVNtHvgG", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1392,15 +1416,17 @@ def before_send(event, hint): "it": { # Italian "12-month": { "id": "price_1J4p3CKb9q6OnNsLK2oBxgsV" if DEV else "price_1J4owvJNcmPzuWtRomVhWQFq", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1J4p6wKb9q6OnNsLTb6kCDsC" if DEV else "price_1J5J6iJNcmPzuWtRK5zfoguV", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1408,15 +1434,17 @@ def before_send(event, hint): "nl": { # Dutch "12-month": { "id": "price_1J4ryxKb9q6OnNsL3fPF8mxI" if DEV else "price_1J5JRGJNcmPzuWtRXwXA84cm", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1J4s0MKb9q6OnNsLS19LMKBb" if DEV else "price_1J5JSkJNcmPzuWtR54LPH2zi", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1424,15 +1452,17 @@ def before_send(event, hint): "pt": { # Portuguese "12-month": { "id": "price_1N7OSoKb9q6OnNsLdJDSaCBW" if DEV else "price_1N7PBOJNcmPzuWtRykt8Uyzm", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N7OUEKb9q6OnNsLXlaW6Ovc" if DEV else "price_1N7PBsJNcmPzuWtRzS5kTc5B", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1440,15 +1470,17 @@ def before_send(event, hint): "ro": { # Romanian "12-month": { "id": "price_1N7ORMKb9q6OnNsLVMHfYXQq" if DEV else "price_1N7PADJNcmPzuWtRxHjlrDiy", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N7OS5Kb9q6OnNsLA2BVYqTG" if DEV else "price_1N7PAmJNcmPzuWtR1zOoPIao", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1456,15 +1488,17 @@ def before_send(event, hint): "sk": { # Slovak "12-month": { "id": "price_1N7OjyKb9q6OnNsLRnctp7yW" if DEV else "price_1N7PKUJNcmPzuWtRrnyAM0wd", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N7OkVKb9q6OnNsL5Vzz6X9D" if DEV else "price_1N7PKyJNcmPzuWtROTKgdgW0", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1472,15 +1506,17 @@ def before_send(event, hint): "sl": { # Slovenian "12-month": { "id": "price_1N7OmEKb9q6OnNsLI2fRSJX3" if DEV else "price_1N7PMcJNcmPzuWtR8TWsjoHe", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99", + "total": "59.88", + "currency": "EUR", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1N7OmiKb9q6OnNsLvXqreUUk" if DEV else "price_1N7PN6JNcmPzuWtRpN8HAr7L", - "price": "9,99 €", + "price": "9.99", "total": None, + "currency": "EUR", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1490,15 +1526,17 @@ def before_send(event, hint): "en": { # English "12-month": { "id": "price_1N7OOaKb9q6OnNsLSUzW83h9" if DEV else "price_1N7P8TJNcmPzuWtRI7pI29bO", - "price": "22 zł", - "total": "264 zł", + "price": "22", + "total": "264", + "currency": "PLN", "saving": 48, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "PLN", "discount": "276", "price": "264", "period": "yearly"}, }, "monthly": { "id": "price_1N7OQWKb9q6OnNsLMLHUFggO" if DEV else "price_1N7P98JNcmPzuWtRbUaI24OH", - "price": "45 zł", + "price": "45", "total": None, + "currency": "PLN", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "PLN", "discount": "0", "price": "45", "period": "monthly"}, }, @@ -1508,15 +1546,17 @@ def before_send(event, hint): "en": { # English "12-month": { "id": "price_1J0Y1iKb9q6OnNsLXwdOFgDr" if DEV else "price_1Iw85dJNcmPzuWtRyhMDdtM7", - "price": "US$4.99", - "total": "US$59.88", + "price": "4.99", + "total": "59.88", + "currency": "USD", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "USD", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1J0owvKb9q6OnNsLExNhEDXm" if DEV else "price_1Iw7qSJNcmPzuWtRMUZpOwLm", - "price": "US$9.99", + "price": "9.99", "total": None, + "currency": "USD", "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "USD", "discount": "0", "price": "9.99", "period": "monthly"}, }, @@ -1730,8 +1770,9 @@ def before_send(event, hint): "en": { "12-month": { "id": "price_1Lwp7uKb9q6OnNsLQYzpzUs5" if DEV else "price_1LwoSDJNcmPzuWtR6wPJZeoh", - "price": "US$6.99", - "total": "US$83.88", + "price": "6.99", + "total": "83.88", + "currency": "USD", "saving": 40, "analytics": { "brand": "vpn",