Skip to content

Commit 7f55b6d

Browse files
committed
chore: wip
1 parent f7e8a4e commit 7f55b6d

6 files changed

Lines changed: 34 additions & 29 deletions

File tree

benefits/enrollment/templates/enrollment/index-init.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@
1313
{% endblock nav-buttons %}
1414

1515
{% block headline %}
16-
<h1 class="pb-4">{{ headline }}</h1>
16+
<div class="d-flex flex-column gap-3 align-items-start pb-4">
17+
<h2 class="p fw-semibold eyebrow-raising">{{ flow }}</h2>
18+
<h1 class="pt-0">{{ headline }}</h1>
19+
</div>
1720
{% endblock headline %}
1821

1922
{% block inner-content %}
2023
{% block paragraphs %}
2124
<p>{{ next_step }}</p>
22-
<p class="mt-4">
25+
<p class="mt-3">
2326
{% translate "You won't be charged, and we don't store your information. Your card details will be sent to our payment partner " %}
2427
<!-- djlint:off --><a href="modal--transit-processor" class="{{ classes }}" data-bs-toggle="modal" data-bs-target="#modal--transit-processor">{{ transit_processor.name }}</a><!-- djlint:on -->
2528
.
2629
</p>
27-
<div class="mt-4">
30+
<div class="mt-3">
2831
{% if alert_include %}
2932
{% include alert_include %}
3033
{% else %}
@@ -41,7 +44,7 @@ <h1 class="pb-4">{{ headline }}</h1>
4144
{% endblock inner-content %}
4245

4346
{% block call-to-action-button %}
44-
<a id="{{ cta_button }}" href="{{ cta_button }}" class="btn btn-lg btn-primary" role="button">
47+
<a id="{{ cta_button }}" href="{% url cta_button %}" class="btn btn-lg btn-primary" role="button">
4548
{% translate "Register your card" %}
4649
</a>
4750
{% endblock call-to-action-button %}

benefits/enrollment_init/templates/enrollment_init/tokenize.html renamed to benefits/enrollment_init/templates/enrollment_init/start.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</script>
88

99
<h1 class="mb-4">Enter your card details</h1>
10-
<form action="./success" method="get">
10+
<form action="{% url success_url %}" method="get">
1111
<!-- Credit card fields -->
1212
<div class="input mt-3">
1313
<span>Card number</span>
@@ -20,12 +20,12 @@ <h1 class="mb-4">Enter your card details</h1>
2020
<p class="error"></p>
2121
</div>
2222
<div class="input mt-4">
23-
<span>Security Code</span>
23+
<span>Security code</span>
2424
<div id="cvv"></div>
2525
<p class="error"></p>
2626
</div>
2727
<!-- Submit the form to your server -->
28-
<button class="btn btn-lg btn-primary mt-5" id="tokenizeButton" type="button">Tokenize card</button>
28+
<button class="btn btn-lg btn-primary mt-5" id="tokenizeButton" type="button">Register my card</button>
2929
</form>
3030

3131
{% comment %} <div>reCAPTCHA</div> {% endcomment %}
@@ -59,9 +59,9 @@ <h1 class="mb-4">Enter your card details</h1>
5959
placeholder: "123",
6060
}
6161
},
62-
validationCallback: function (field, status, message) {
63-
if (status) return // if field is valid, short-circuit
64-
document.querySelector(`#${field} + p`).innerText = message;
62+
validationCallback: function (field, valid, message) {
63+
const errNode = document.querySelector(`#${field} + p`)
64+
errNode.innerText = valid ? '' : message;
6565
},
6666
timeoutDuration: 10000,
6767
timeoutCallback: function () {

benefits/enrollment_init/urls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from django.urls import path
22

3-
from benefits.enrollment_init.views import IndexView, SuccessView, TokenizeView
3+
from benefits.enrollment_init.views import IndexView, StartView, SuccessView
44
from benefits.routes import routes
55

66
app_name = "init"
77
urlpatterns = [
8-
# /init
8+
# /init/
99
path("", IndexView.as_view(), name=routes.name(routes.ENROLLMENT_INIT_INDEX)),
10-
# /init/tokenize
11-
path("tokenize", TokenizeView.as_view(), name=routes.name(routes.ENROLLMENT_INIT_TOKENIZE)),
10+
# /init/start
11+
path("start", StartView.as_view(), name=routes.name(routes.ENROLLMENT_INIT_START)),
1212
# /init/success
1313
path("success", SuccessView.as_view(), name=routes.name(routes.ENROLLMENT_INIT_SUCCESS)),
1414
]

benefits/enrollment_init/views.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ class IndexView(AgencySessionRequiredMixin, IndexContextMixin, FormView):
1717
"""View for the enrollment landing page."""
1818

1919
enrollment_method = models.EnrollmentMethods.SELF_SERVICE
20-
form_class = forms.CardTokenizeSuccessForm
21-
route_enrollment_success = routes.ENROLLMENT_SUCCESS
22-
route_reenrollment_error = routes.ENROLLMENT_REENROLLMENT_ERROR
23-
route_retry = routes.ENROLLMENT_RETRY
24-
route_system_error = routes.ENROLLMENT_SYSTEM_ERROR
25-
route_server_error = routes.SERVER_ERROR
26-
route_tokenize_success = routes.ENROLLMENT_INIT_INDEX
2720
template_name = "enrollment_init/index.html"
2821

2922
def get_context_data(self, **kwargs):
@@ -34,8 +27,9 @@ def get_context_data(self, **kwargs):
3427
"headline": _("You are eligible for a reduced fare!"),
3528
"next_step": _("The last step is to register a bank card so you get a reduced fare when you tap."),
3629
"collect_js_api_key": self.agency.init_config.tokenization_api_key,
37-
"cta_button": "./tokenize",
30+
"cta_button": routes.ENROLLMENT_INIT_START,
3831
"enrollment_method": self.enrollment_method,
32+
"flow": self.flow,
3933
"transit_processor": {
4034
"name": "INIT",
4135
"website": "https://www.initse.com/enus/solutions/fare-collection-revenue-management/",
@@ -45,7 +39,7 @@ def get_context_data(self, **kwargs):
4539
return context
4640

4741

48-
class TokenizeView(AgencySessionRequiredMixin, IndexContextMixin, FormView):
42+
class StartView(AgencySessionRequiredMixin, IndexContextMixin, FormView):
4943
"""View for the page that tokenizes the user card."""
5044

5145
enrollment_method = models.EnrollmentMethods.SELF_SERVICE
@@ -55,8 +49,8 @@ class TokenizeView(AgencySessionRequiredMixin, IndexContextMixin, FormView):
5549
route_retry = routes.ENROLLMENT_RETRY
5650
route_system_error = routes.ENROLLMENT_SYSTEM_ERROR
5751
route_server_error = routes.SERVER_ERROR
58-
route_tokenize_success = routes.ENROLLMENT_INIT_INDEX
59-
template_name = "enrollment_init/tokenize.html"
52+
route_tokenize_success = routes.ENROLLMENT_INIT_SUCCESS
53+
template_name = "enrollment_init/start.html"
6054

6155
def get_context_data(self, **kwargs):
6256
context = super().get_context_data(**kwargs)
@@ -67,13 +61,14 @@ def get_context_data(self, **kwargs):
6761
tokenize_success_form = forms.CardTokenizeSuccessForm(
6862
action_url=self.route_tokenize_success, auto_id=True, label_suffix=""
6963
)
64+
7065
context.update(
7166
{
7267
"collect_js_api_key": self.agency.init_config.tokenization_api_key,
7368
"forms": [tokenize_system_error_form, tokenize_success_form],
7469
"form_success": tokenize_success_form.id,
7570
"form_system_error": tokenize_system_error_form.id,
76-
"cta_button": "./tokenize",
71+
"success_url": self.route_tokenize_success,
7772
"enrollment_method": self.enrollment_method,
7873
"transit_processor": {
7974
"name": "INIT",

benefits/routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ def ENROLLMENT_INIT_INDEX(self):
105105
return "init:index"
106106

107107
@property
108-
def ENROLLMENT_INIT_TOKENIZE(self):
108+
def ENROLLMENT_INIT_START(self):
109109
"""Time to tokenize, using Init."""
110-
return "init:tokenize"
110+
return "init:start"
111111

112112
@property
113113
def ENROLLMENT_INIT_SUCCESS(self):
114114
"""Tokenization complete, using Init."""
115-
return "init:tokenize"
115+
return "init:success"
116116

117117
@property
118118
def ENROLLMENT_SWITCHIO_GATEWAY_URL(self):

benefits/static/css/styles.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,3 +822,10 @@ footer .footer-links li a.footer-link:visited {
822822
.additional-agency {
823823
border-bottom: 1px solid var(--dsdl-gray-40);
824824
}
825+
826+
.eyebrow-raising {
827+
border-radius: var(--border-radius, 3px);
828+
background: var(--Color-Cyan-cyan-10, #dff3fe);
829+
margin-top: calc(72rem / 16);
830+
padding: 4px 8px;
831+
}

0 commit comments

Comments
 (0)