We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bug: Error page bug - Log out button too low
A clear and concise description of what the bug is.

## To Reproduce

Steps to reproduce the behavior:

1. Go through the Login.gov IAL2 flow with a user who is under age 65
2. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots

Tablet/Mobile widths are off:
<img width="485" alt="image" src="https://user-images.githubusercontent.com/3673236/190286767-dc5e2f26-3a48-44e7-a480-9751726938ea.png">
<img width="457" alt="image" src="https://user-images.githubusercontent.com/3673236/190287117-4c1072cb-271d-4b1a-b0c8-00f7dd958302.png">

Desktop is good:
<img width="1440" alt="image" src="https://user-images.githubusercontent.com/3673236/190287052-4c8a778a-7ccf-42dd-8042-c59a0b350308.png">


## Desktop (please complete the following information)

- OS: [e.g. iOS]

## Smartphone (please complete the following information)

- Device: [e.g. iPhone6]

## Additional context

Add any other context about the problem here.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `benefits/enrollment/views.py`
Content:
```
1 """
2 The enrollment application: view definitions for the benefits enrollment flow.
3 """
4 import logging
5 
6 from django.http import JsonResponse
7 from django.template.response import TemplateResponse
8 from django.urls import reverse
9 from django.utils.html import format_html
10 from django.utils.decorators import decorator_from_middleware
11 from django.utils.translation import pgettext, gettext as _
12 
13 from benefits.core import models, session, viewmodels
14 from benefits.core.middleware import EligibleSessionRequired, VerifierSessionRequired, pageview_decorator
15 from benefits.core.views import ROUTE_HELP, ROUTE_LOGGED_OUT
16 from . import analytics, api, forms
17 
18 
19 ROUTE_INDEX = "enrollment:index"
20 ROUTE_RETRY = "enrollment:retry"
21 ROUTE_SUCCESS = "enrollment:success"
22 ROUTE_TOKEN = "enrollment:token"
23 
24 TEMPLATE_INDEX = "enrollment/index.html"
25 TEMPLATE_RETRY = "enrollment/retry.html"
26 TEMPLATE_SUCCESS = "enrollment/success.html"
27 
28 
29 logger = logging.getLogger(__name__)
30 
31 
32 @decorator_from_middleware(EligibleSessionRequired)
33 def token(request):
34     """View handler for the enrollment auth token."""
35     if not session.enrollment_token_valid(request):
36         agency = session.agency(request)
37         response = api.Client(agency).access_token()
38         session.update(request, enrollment_token=response.access_token, enrollment_token_exp=response.expiry)
39 
40     data = {"token": session.enrollment_token(request)}
41 
42     return JsonResponse(data)
43 
44 
45 @decorator_from_middleware(EligibleSessionRequired)
46 def index(request):
47     """View handler for the enrollment landing page."""
48     session.update(request, origin=reverse(ROUTE_INDEX))
49 
50     agency = session.agency(request)
51     verifier = session.verifier(request)
52 
53     # POST back after payment processor form, process card token
54     if request.method == "POST":
55         form = forms.CardTokenizeSuccessForm(request.POST)
56         if not form.is_valid():
57             raise Exception("Invalid card token form")
58 
59         eligibility = session.eligibility(request)
60         logger.debug(f"Session contains an {models.EligibilityType.__name__}")
61 
62         logger.debug("Read tokenized card")
63         card_token = form.cleaned_data.get("card_token")
64 
65         response = api.Client(agency).enroll(card_token, eligibility.group_id)
66         if response.success:
67             analytics.returned_success(request, eligibility.group_id)
68             return success(request)
69         else:
70             analytics.returned_error(request, response.message)
71             raise Exception(response.message)
72 
73     # GET enrollment index, with button to initiate payment processor connection
74     else:
75         tokenize_button = "tokenize_card"
76         tokenize_retry_form = forms.CardTokenizeFailForm(ROUTE_RETRY)
77         tokenize_success_form = forms.CardTokenizeSuccessForm(auto_id=True, label_suffix="")
78 
79         confirmed_eligibility_item = viewmodels.MediaItem(
80             icon=viewmodels.Icon("happybus", pgettext("image alt text", "core.icons.happybus")),
81             heading=_(verifier.eligibility_confirmed_item_heading),
82             details=_(verifier.eligibility_confirmed_item_details),
83         )
84 
85         help_link = reverse(ROUTE_HELP)
86         link_card_item = viewmodels.MediaItem(
87             icon=viewmodels.Icon("bankcardcheck", pgettext("image alt text", "core.icons.bankcardcheck")),
88             heading=_("enrollment.pages.index.link_card_item.heading"),
89             details=[
90                 format_html(_("enrollment.pages.index.link_card_item.p[0]%(link)s") % {"link": f"{help_link}#littlepay"}),
91                 _("enrollment.pages.index.link_card_item.p[1]"),
92             ],
93         )
94 
95         media = [confirmed_eligibility_item, link_card_item]
96 
97         page = viewmodels.Page(
98             title=_("enrollment.pages.index.title"),
99             headline=_("enrollment.pages.index.headline"),
100             forms=[tokenize_retry_form, tokenize_success_form],
101             buttons=[
102                 viewmodels.Button.primary(
103                     text=_("enrollment.buttons.payment_partner"), id=tokenize_button, url=f"#{tokenize_button}"
104                 ),
105             ],
106         )
107         context = {"media": media}
108         context.update(page.context_dict())
109 
110         # add agency details
111         agency_vm = viewmodels.TransitAgency(agency)
112         context.update(agency_vm.context_dict())
113 
114         # and payment processor details
115         processor_vm = viewmodels.PaymentProcessor(
116             model=agency.payment_processor,
117             access_token_url=reverse(ROUTE_TOKEN),
118             element_id=f"#{tokenize_button}",
119             color="#046b99",
120             name=f"{agency.long_name} {_('partnered with')} {agency.payment_processor.name}",
121         )
122         context.update(processor_vm.context_dict())
123         logger.warning(f"card_tokenize_url: {context['payment_processor'].card_tokenize_url}")
124 
125         # the tokenize form URLs are injected to page-generated Javascript
126         context["forms"] = {
127             "tokenize_retry": reverse(tokenize_retry_form.action_url),
128             "tokenize_success": reverse(tokenize_success_form.action_url),
129         }
130 
131         return TemplateResponse(request, TEMPLATE_INDEX, context)
132 
133 
134 @decorator_from_middleware(EligibleSessionRequired)
135 def retry(request):
136     """View handler for a recoverable failure condition."""
137     if request.method == "POST":
138         analytics.returned_retry(request)
139         form = forms.CardTokenizeFailForm(request.POST)
140         if form.is_valid():
141             agency = session.agency(request)
142             page = viewmodels.Page(
143                 classes="no-image-mobile",
144                 title=_("enrollment.pages.retry.title"),
145                 icon=viewmodels.Icon("bankcardquestion", pgettext("image alt text", "core.icons.bankcardquestion")),
146                 headline=_("enrollment.pages.retry.title"),
147                 paragraphs=[_("enrollment.pages.retry.p[0]")],
148                 buttons=viewmodels.Button.agency_contact_links(agency),
149             )
150             page.buttons.append(viewmodels.Button.primary(text=_("core.buttons.retry"), url=session.origin(request)))
151             return TemplateResponse(request, TEMPLATE_RETRY, page.context_dict())
152         else:
153             analytics.returned_error(request, "Invalid retry submission.")
154             raise Exception("Invalid retry submission.")
155     else:
156         analytics.returned_error(request, "This view method only supports POST.")
157         raise Exception("This view method only supports POST.")
158 
159 
160 @pageview_decorator
161 @decorator_from_middleware(VerifierSessionRequired)
162 def success(request):
163     """View handler for the final success page."""
164     request.path = "/enrollment/success"
165     session.update(request, origin=reverse(ROUTE_SUCCESS))
166 
167     verifier = session.verifier(request)
168 
169     page = viewmodels.Page(title=_("enrollment.pages.success.title"), headline=_("enrollment.pages.success.headline"))
170 
171     if verifier.is_auth_required and session.logged_in(request):
172         # overwrite origin for a logged in user
173         # if they click the logout button, they are taken to the new route
174         session.update(request, origin=reverse(ROUTE_LOGGED_OUT))
175         page.buttons = [viewmodels.Button.logout()]
176 
177     success_item = viewmodels.MediaItem(
178         icon=viewmodels.Icon("happybus", pgettext("image alt text", "core.icons.happybus")),
179         details=[
180             _(verifier.enrollment_success_confirm_item_details),
181             format_html(_("enrollment.pages.success.helplink%(link)s") % {"link": f"{reverse(ROUTE_HELP)}"}),
182         ],
183     )
184     media = [success_item]
185 
186     if verifier.enrollment_success_expiry_item_heading or verifier.enrollment_success_expiry_item_details:
187         heading = (
188             _(verifier.enrollment_success_expiry_item_heading) if verifier.enrollment_success_expiry_item_heading else None
189         )
190         details = (
191             _(verifier.enrollment_success_expiry_item_details) if verifier.enrollment_success_expiry_item_details else None
192         )
193         expiry_item = viewmodels.MediaItem(
194             icon=viewmodels.Icon("calendarcheck", pgettext("image alt text", "core.icons.calendarcheck")),
195             heading=heading,
196             details=details,
197         )
198         media.insert(0, expiry_item)
199 
200     context = {"media": media}
201     context.update(page.context_dict())
202 
203     return TemplateResponse(request, TEMPLATE_SUCCESS, context)
204
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/benefits/enrollment/views.py b/benefits/enrollment/views.py
--- a/benefits/enrollment/views.py
+++ b/benefits/enrollment/views.py
@@ -140,7 +140,6 @@
         if form.is_valid():
             agency = session.agency(request)
             page = viewmodels.Page(
-                classes="no-image-mobile",
                 title=_("enrollment.pages.retry.title"),
                 icon=viewmodels.Icon("bankcardquestion", pgettext("image alt text", "core.icons.bankcardquestion")),
                 headline=_("enrollment.pages.retry.title"),

{"golden_diff": "diff --git a/benefits/enrollment/views.py b/benefits/enrollment/views.py\n--- a/benefits/enrollment/views.py\n+++ b/benefits/enrollment/views.py\n@@ -140,7 +140,6 @@\n         if form.is_valid():\n             agency = session.agency(request)\n             page = viewmodels.Page(\n-                classes=\"no-image-mobile\",\n                 title=_(\"enrollment.pages.retry.title\"),\n                 icon=viewmodels.Icon(\"bankcardquestion\", pgettext(\"image alt text\", \"core.icons.bankcardquestion\")),\n                 headline=_(\"enrollment.pages.retry.title\"),\n", "issue": "Bug: Error page bug - Log out button too low\nA clear and concise description of what the bug is.\r\n\r\n## To Reproduce\r\n\r\nSteps to reproduce the behavior:\r\n\r\n1. Go through the Login.gov IAL2 flow with a user who is under age 65\r\n2. See error\r\n\r\n## Expected behavior\r\n\r\nA clear and concise description of what you expected to happen.\r\n\r\n## Screenshots\r\n\r\nTablet/Mobile widths are off:\r\n<img width=\"485\" alt=\"image\" src=\"https://user-images.githubusercontent.com/3673236/190286767-dc5e2f26-3a48-44e7-a480-9751726938ea.png\">\r\n<img width=\"457\" alt=\"image\" src=\"https://user-images.githubusercontent.com/3673236/190287117-4c1072cb-271d-4b1a-b0c8-00f7dd958302.png\">\r\n\r\nDesktop is good:\r\n<img width=\"1440\" alt=\"image\" src=\"https://user-images.githubusercontent.com/3673236/190287052-4c8a778a-7ccf-42dd-8042-c59a0b350308.png\">\r\n\r\n\r\n## Desktop (please complete the following information)\r\n\r\n- OS: [e.g. iOS]\r\n\r\n## Smartphone (please complete the following information)\r\n\r\n- Device: [e.g. iPhone6]\r\n\r\n## Additional context\r\n\r\nAdd any other context about the problem here.\r\n\n", "before_files": [{"content": "\"\"\"\nThe enrollment application: view definitions for the benefits enrollment flow.\n\"\"\"\nimport logging\n\nfrom django.http import JsonResponse\nfrom django.template.response import TemplateResponse\nfrom django.urls import reverse\nfrom django.utils.html import format_html\nfrom django.utils.decorators import decorator_from_middleware\nfrom django.utils.translation import pgettext, gettext as _\n\nfrom benefits.core import models, session, viewmodels\nfrom benefits.core.middleware import EligibleSessionRequired, VerifierSessionRequired, pageview_decorator\nfrom benefits.core.views import ROUTE_HELP, ROUTE_LOGGED_OUT\nfrom . import analytics, api, forms\n\n\nROUTE_INDEX = \"enrollment:index\"\nROUTE_RETRY = \"enrollment:retry\"\nROUTE_SUCCESS = \"enrollment:success\"\nROUTE_TOKEN = \"enrollment:token\"\n\nTEMPLATE_INDEX = \"enrollment/index.html\"\nTEMPLATE_RETRY = \"enrollment/retry.html\"\nTEMPLATE_SUCCESS = \"enrollment/success.html\"\n\n\nlogger = logging.getLogger(__name__)\n\n\n@decorator_from_middleware(EligibleSessionRequired)\ndef token(request):\n    \"\"\"View handler for the enrollment auth token.\"\"\"\n    if not session.enrollment_token_valid(request):\n        agency = session.agency(request)\n        response = api.Client(agency).access_token()\n        session.update(request, enrollment_token=response.access_token, enrollment_token_exp=response.expiry)\n\n    data = {\"token\": session.enrollment_token(request)}\n\n    return JsonResponse(data)\n\n\n@decorator_from_middleware(EligibleSessionRequired)\ndef index(request):\n    \"\"\"View handler for the enrollment landing page.\"\"\"\n    session.update(request, origin=reverse(ROUTE_INDEX))\n\n    agency = session.agency(request)\n    verifier = session.verifier(request)\n\n    # POST back after payment processor form, process card token\n    if request.method == \"POST\":\n        form = forms.CardTokenizeSuccessForm(request.POST)\n        if not form.is_valid():\n            raise Exception(\"Invalid card token form\")\n\n        eligibility = session.eligibility(request)\n        logger.debug(f\"Session contains an {models.EligibilityType.__name__}\")\n\n        logger.debug(\"Read tokenized card\")\n        card_token = form.cleaned_data.get(\"card_token\")\n\n        response = api.Client(agency).enroll(card_token, eligibility.group_id)\n        if response.success:\n            analytics.returned_success(request, eligibility.group_id)\n            return success(request)\n        else:\n            analytics.returned_error(request, response.message)\n            raise Exception(response.message)\n\n    # GET enrollment index, with button to initiate payment processor connection\n    else:\n        tokenize_button = \"tokenize_card\"\n        tokenize_retry_form = forms.CardTokenizeFailForm(ROUTE_RETRY)\n        tokenize_success_form = forms.CardTokenizeSuccessForm(auto_id=True, label_suffix=\"\")\n\n        confirmed_eligibility_item = viewmodels.MediaItem(\n            icon=viewmodels.Icon(\"happybus\", pgettext(\"image alt text\", \"core.icons.happybus\")),\n            heading=_(verifier.eligibility_confirmed_item_heading),\n            details=_(verifier.eligibility_confirmed_item_details),\n        )\n\n        help_link = reverse(ROUTE_HELP)\n        link_card_item = viewmodels.MediaItem(\n            icon=viewmodels.Icon(\"bankcardcheck\", pgettext(\"image alt text\", \"core.icons.bankcardcheck\")),\n            heading=_(\"enrollment.pages.index.link_card_item.heading\"),\n            details=[\n                format_html(_(\"enrollment.pages.index.link_card_item.p[0]%(link)s\") % {\"link\": f\"{help_link}#littlepay\"}),\n                _(\"enrollment.pages.index.link_card_item.p[1]\"),\n            ],\n        )\n\n        media = [confirmed_eligibility_item, link_card_item]\n\n        page = viewmodels.Page(\n            title=_(\"enrollment.pages.index.title\"),\n            headline=_(\"enrollment.pages.index.headline\"),\n            forms=[tokenize_retry_form, tokenize_success_form],\n            buttons=[\n                viewmodels.Button.primary(\n                    text=_(\"enrollment.buttons.payment_partner\"), id=tokenize_button, url=f\"#{tokenize_button}\"\n                ),\n            ],\n        )\n        context = {\"media\": media}\n        context.update(page.context_dict())\n\n        # add agency details\n        agency_vm = viewmodels.TransitAgency(agency)\n        context.update(agency_vm.context_dict())\n\n        # and payment processor details\n        processor_vm = viewmodels.PaymentProcessor(\n            model=agency.payment_processor,\n            access_token_url=reverse(ROUTE_TOKEN),\n            element_id=f\"#{tokenize_button}\",\n            color=\"#046b99\",\n            name=f\"{agency.long_name} {_('partnered with')} {agency.payment_processor.name}\",\n        )\n        context.update(processor_vm.context_dict())\n        logger.warning(f\"card_tokenize_url: {context['payment_processor'].card_tokenize_url}\")\n\n        # the tokenize form URLs are injected to page-generated Javascript\n        context[\"forms\"] = {\n            \"tokenize_retry\": reverse(tokenize_retry_form.action_url),\n            \"tokenize_success\": reverse(tokenize_success_form.action_url),\n        }\n\n        return TemplateResponse(request, TEMPLATE_INDEX, context)\n\n\n@decorator_from_middleware(EligibleSessionRequired)\ndef retry(request):\n    \"\"\"View handler for a recoverable failure condition.\"\"\"\n    if request.method == \"POST\":\n        analytics.returned_retry(request)\n        form = forms.CardTokenizeFailForm(request.POST)\n        if form.is_valid():\n            agency = session.agency(request)\n            page = viewmodels.Page(\n                classes=\"no-image-mobile\",\n                title=_(\"enrollment.pages.retry.title\"),\n                icon=viewmodels.Icon(\"bankcardquestion\", pgettext(\"image alt text\", \"core.icons.bankcardquestion\")),\n                headline=_(\"enrollment.pages.retry.title\"),\n                paragraphs=[_(\"enrollment.pages.retry.p[0]\")],\n                buttons=viewmodels.Button.agency_contact_links(agency),\n            )\n            page.buttons.append(viewmodels.Button.primary(text=_(\"core.buttons.retry\"), url=session.origin(request)))\n            return TemplateResponse(request, TEMPLATE_RETRY, page.context_dict())\n        else:\n            analytics.returned_error(request, \"Invalid retry submission.\")\n            raise Exception(\"Invalid retry submission.\")\n    else:\n        analytics.returned_error(request, \"This view method only supports POST.\")\n        raise Exception(\"This view method only supports POST.\")\n\n\n@pageview_decorator\n@decorator_from_middleware(VerifierSessionRequired)\ndef success(request):\n    \"\"\"View handler for the final success page.\"\"\"\n    request.path = \"/enrollment/success\"\n    session.update(request, origin=reverse(ROUTE_SUCCESS))\n\n    verifier = session.verifier(request)\n\n    page = viewmodels.Page(title=_(\"enrollment.pages.success.title\"), headline=_(\"enrollment.pages.success.headline\"))\n\n    if verifier.is_auth_required and session.logged_in(request):\n        # overwrite origin for a logged in user\n        # if they click the logout button, they are taken to the new route\n        session.update(request, origin=reverse(ROUTE_LOGGED_OUT))\n        page.buttons = [viewmodels.Button.logout()]\n\n    success_item = viewmodels.MediaItem(\n        icon=viewmodels.Icon(\"happybus\", pgettext(\"image alt text\", \"core.icons.happybus\")),\n        details=[\n            _(verifier.enrollment_success_confirm_item_details),\n            format_html(_(\"enrollment.pages.success.helplink%(link)s\") % {\"link\": f\"{reverse(ROUTE_HELP)}\"}),\n        ],\n    )\n    media = [success_item]\n\n    if verifier.enrollment_success_expiry_item_heading or verifier.enrollment_success_expiry_item_details:\n        heading = (\n            _(verifier.enrollment_success_expiry_item_heading) if verifier.enrollment_success_expiry_item_heading else None\n        )\n        details = (\n            _(verifier.enrollment_success_expiry_item_details) if verifier.enrollment_success_expiry_item_details else None\n        )\n        expiry_item = viewmodels.MediaItem(\n            icon=viewmodels.Icon(\"calendarcheck\", pgettext(\"image alt text\", \"core.icons.calendarcheck\")),\n            heading=heading,\n            details=details,\n        )\n        media.insert(0, expiry_item)\n\n    context = {\"media\": media}\n    context.update(page.context_dict())\n\n    return TemplateResponse(request, TEMPLATE_SUCCESS, context)\n", "path": "benefits/enrollment/views.py"}], "after_files": [{"content": "\"\"\"\nThe enrollment application: view definitions for the benefits enrollment flow.\n\"\"\"\nimport logging\n\nfrom django.http import JsonResponse\nfrom django.template.response import TemplateResponse\nfrom django.urls import reverse\nfrom django.utils.html import format_html\nfrom django.utils.decorators import decorator_from_middleware\nfrom django.utils.translation import pgettext, gettext as _\n\nfrom benefits.core import models, session, viewmodels\nfrom benefits.core.middleware import EligibleSessionRequired, VerifierSessionRequired, pageview_decorator\nfrom benefits.core.views import ROUTE_HELP, ROUTE_LOGGED_OUT\nfrom . import analytics, api, forms\n\n\nROUTE_INDEX = \"enrollment:index\"\nROUTE_RETRY = \"enrollment:retry\"\nROUTE_SUCCESS = \"enrollment:success\"\nROUTE_TOKEN = \"enrollment:token\"\n\nTEMPLATE_INDEX = \"enrollment/index.html\"\nTEMPLATE_RETRY = \"enrollment/retry.html\"\nTEMPLATE_SUCCESS = \"enrollment/success.html\"\n\n\nlogger = logging.getLogger(__name__)\n\n\n@decorator_from_middleware(EligibleSessionRequired)\ndef token(request):\n    \"\"\"View handler for the enrollment auth token.\"\"\"\n    if not session.enrollment_token_valid(request):\n        agency = session.agency(request)\n        response = api.Client(agency).access_token()\n        session.update(request, enrollment_token=response.access_token, enrollment_token_exp=response.expiry)\n\n    data = {\"token\": session.enrollment_token(request)}\n\n    return JsonResponse(data)\n\n\n@decorator_from_middleware(EligibleSessionRequired)\ndef index(request):\n    \"\"\"View handler for the enrollment landing page.\"\"\"\n    session.update(request, origin=reverse(ROUTE_INDEX))\n\n    agency = session.agency(request)\n    verifier = session.verifier(request)\n\n    # POST back after payment processor form, process card token\n    if request.method == \"POST\":\n        form = forms.CardTokenizeSuccessForm(request.POST)\n        if not form.is_valid():\n            raise Exception(\"Invalid card token form\")\n\n        eligibility = session.eligibility(request)\n        logger.debug(f\"Session contains an {models.EligibilityType.__name__}\")\n\n        logger.debug(\"Read tokenized card\")\n        card_token = form.cleaned_data.get(\"card_token\")\n\n        response = api.Client(agency).enroll(card_token, eligibility.group_id)\n        if response.success:\n            analytics.returned_success(request, eligibility.group_id)\n            return success(request)\n        else:\n            analytics.returned_error(request, response.message)\n            raise Exception(response.message)\n\n    # GET enrollment index, with button to initiate payment processor connection\n    else:\n        tokenize_button = \"tokenize_card\"\n        tokenize_retry_form = forms.CardTokenizeFailForm(ROUTE_RETRY)\n        tokenize_success_form = forms.CardTokenizeSuccessForm(auto_id=True, label_suffix=\"\")\n\n        confirmed_eligibility_item = viewmodels.MediaItem(\n            icon=viewmodels.Icon(\"happybus\", pgettext(\"image alt text\", \"core.icons.happybus\")),\n            heading=_(verifier.eligibility_confirmed_item_heading),\n            details=_(verifier.eligibility_confirmed_item_details),\n        )\n\n        help_link = reverse(ROUTE_HELP)\n        link_card_item = viewmodels.MediaItem(\n            icon=viewmodels.Icon(\"bankcardcheck\", pgettext(\"image alt text\", \"core.icons.bankcardcheck\")),\n            heading=_(\"enrollment.pages.index.link_card_item.heading\"),\n            details=[\n                format_html(_(\"enrollment.pages.index.link_card_item.p[0]%(link)s\") % {\"link\": f\"{help_link}#littlepay\"}),\n                _(\"enrollment.pages.index.link_card_item.p[1]\"),\n            ],\n        )\n\n        media = [confirmed_eligibility_item, link_card_item]\n\n        page = viewmodels.Page(\n            title=_(\"enrollment.pages.index.title\"),\n            headline=_(\"enrollment.pages.index.headline\"),\n            forms=[tokenize_retry_form, tokenize_success_form],\n            buttons=[\n                viewmodels.Button.primary(\n                    text=_(\"enrollment.buttons.payment_partner\"), id=tokenize_button, url=f\"#{tokenize_button}\"\n                ),\n            ],\n        )\n        context = {\"media\": media}\n        context.update(page.context_dict())\n\n        # add agency details\n        agency_vm = viewmodels.TransitAgency(agency)\n        context.update(agency_vm.context_dict())\n\n        # and payment processor details\n        processor_vm = viewmodels.PaymentProcessor(\n            model=agency.payment_processor,\n            access_token_url=reverse(ROUTE_TOKEN),\n            element_id=f\"#{tokenize_button}\",\n            color=\"#046b99\",\n            name=f\"{agency.long_name} {_('partnered with')} {agency.payment_processor.name}\",\n        )\n        context.update(processor_vm.context_dict())\n        logger.warning(f\"card_tokenize_url: {context['payment_processor'].card_tokenize_url}\")\n\n        # the tokenize form URLs are injected to page-generated Javascript\n        context[\"forms\"] = {\n            \"tokenize_retry\": reverse(tokenize_retry_form.action_url),\n            \"tokenize_success\": reverse(tokenize_success_form.action_url),\n        }\n\n        return TemplateResponse(request, TEMPLATE_INDEX, context)\n\n\n@decorator_from_middleware(EligibleSessionRequired)\ndef retry(request):\n    \"\"\"View handler for a recoverable failure condition.\"\"\"\n    if request.method == \"POST\":\n        analytics.returned_retry(request)\n        form = forms.CardTokenizeFailForm(request.POST)\n        if form.is_valid():\n            agency = session.agency(request)\n            page = viewmodels.Page(\n                title=_(\"enrollment.pages.retry.title\"),\n                icon=viewmodels.Icon(\"bankcardquestion\", pgettext(\"image alt text\", \"core.icons.bankcardquestion\")),\n                headline=_(\"enrollment.pages.retry.title\"),\n                paragraphs=[_(\"enrollment.pages.retry.p[0]\")],\n                buttons=viewmodels.Button.agency_contact_links(agency),\n            )\n            page.buttons.append(viewmodels.Button.primary(text=_(\"core.buttons.retry\"), url=session.origin(request)))\n            return TemplateResponse(request, TEMPLATE_RETRY, page.context_dict())\n        else:\n            analytics.returned_error(request, \"Invalid retry submission.\")\n            raise Exception(\"Invalid retry submission.\")\n    else:\n        analytics.returned_error(request, \"This view method only supports POST.\")\n        raise Exception(\"This view method only supports POST.\")\n\n\n@pageview_decorator\n@decorator_from_middleware(VerifierSessionRequired)\ndef success(request):\n    \"\"\"View handler for the final success page.\"\"\"\n    request.path = \"/enrollment/success\"\n    session.update(request, origin=reverse(ROUTE_SUCCESS))\n\n    verifier = session.verifier(request)\n\n    page = viewmodels.Page(title=_(\"enrollment.pages.success.title\"), headline=_(\"enrollment.pages.success.headline\"))\n\n    if verifier.is_auth_required and session.logged_in(request):\n        # overwrite origin for a logged in user\n        # if they click the logout button, they are taken to the new route\n        session.update(request, origin=reverse(ROUTE_LOGGED_OUT))\n        page.buttons = [viewmodels.Button.logout()]\n\n    success_item = viewmodels.MediaItem(\n        icon=viewmodels.Icon(\"happybus\", pgettext(\"image alt text\", \"core.icons.happybus\")),\n        details=[\n            _(verifier.enrollment_success_confirm_item_details),\n            format_html(_(\"enrollment.pages.success.helplink%(link)s\") % {\"link\": f\"{reverse(ROUTE_HELP)}\"}),\n        ],\n    )\n    media = [success_item]\n\n    if verifier.enrollment_success_expiry_item_heading or verifier.enrollment_success_expiry_item_details:\n        heading = (\n            _(verifier.enrollment_success_expiry_item_heading) if verifier.enrollment_success_expiry_item_heading else None\n        )\n        details = (\n            _(verifier.enrollment_success_expiry_item_details) if verifier.enrollment_success_expiry_item_details else None\n        )\n        expiry_item = viewmodels.MediaItem(\n            icon=viewmodels.Icon(\"calendarcheck\", pgettext(\"image alt text\", \"core.icons.calendarcheck\")),\n            heading=heading,\n            details=details,\n        )\n        media.insert(0, expiry_item)\n\n    context = {\"media\": media}\n    context.update(page.context_dict())\n\n    return TemplateResponse(request, TEMPLATE_SUCCESS, context)\n", "path": "benefits/enrollment/views.py"}]}