Skip to content

Commit 091beb5

Browse files
maebealeclaude
andcommitted
Remove "Other" payment method from registration forms
The "Other" option offered no clear meaning to registrants and added noise to the payment choice, so drop it from the form builder's payment method options. New registration and bulk payment forms no longer offer it; existing forms are left as-is. Scholarship applicants previously had "Other" preselected; they now see the same default as everyone else, and are still never charged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0547be6 commit 091beb5

5 files changed

Lines changed: 11 additions & 18 deletions

File tree

app/services/form_builder_service.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ class FormBuilderService
33
# charge, so controllers match against PAYMENT_METHOD_PAY_NOW rather than
44
# repeating its label. Keep this the single source of truth for the label.
55
PAYMENT_METHOD_PAY_NOW = "Credit card (now)".freeze
6-
# "Other" is retained as a payment method in code and form data — the scholarship
7-
# flow stores it as the payment method — but it is intentionally hidden from the
8-
# options surfaced on public forms for now (see the public registration and bulk
9-
# payment views, which filter it out).
10-
PAYMENT_METHOD_OTHER = "Other".freeze
11-
PAYMENT_METHOD_OPTIONS = [ PAYMENT_METHOD_PAY_NOW, "Credit card (later)", "Check", PAYMENT_METHOD_OTHER ].freeze
6+
PAYMENT_METHOD_OPTIONS = [ PAYMENT_METHOD_PAY_NOW, "Credit card (later)", "Check" ].freeze
127

138
SECTIONS = {
149
person_identifier: { label: "Person identifier", method: :build_person_identifier_fields },

app/views/events/bulk_payments/new.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@
134134
<% if field.required %><span class="text-red-500">*</span><% end %>
135135
</label>
136136
<div class="flex flex-wrap gap-2 mt-1">
137-
<%# "Other" is kept in code/data but hidden on the form for now. %>
138-
<% field.form_field_answer_options.includes(:answer_option).reject { |ffao| ffao.answer_option.name == FormBuilderService::PAYMENT_METHOD_OTHER }.each do |ffao| %>
137+
<% field.form_field_answer_options.includes(:answer_option).each do |ffao| %>
139138
<label class="inline-flex items-center gap-2 rounded-lg border <%= error ? 'border-red-400' : 'border-gray-300' %> px-3 py-2.5 cursor-pointer hover:border-blue-400 has-[:checked]:border-blue-600 has-[:checked]:bg-blue-50 transition">
140139
<input type="radio"
141140
name="bulk_payment[form_fields][<%= field.id %>]"

app/views/events/public_registrations/_form_field.html.erb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@
7272
data and store none of their own, so fall back to those when present. %>
7373
<% radio_options = dynamic_form_field_options(field) ||
7474
field.form_field_answer_options.includes(:answer_option).map { |ffao| [ ffao.answer_option.name, ffao.answer_option.name ] } %>
75-
<%# "Other" is hidden on the payment method field for now (it stays in code/data
76-
for the scholarship flow). Keep it only when it's already the selected value
77-
so a preset/stored "Other" still renders checked. %>
78-
<% if field.field_identifier == "payment_method" %>
79-
<% radio_options = radio_options.reject { |_option_label, option_value| option_value == FormBuilderService::PAYMENT_METHOD_OTHER && value != FormBuilderService::PAYMENT_METHOD_OTHER } %>
80-
<% end %>
8175
<% has_specify = radio_options.any? { |option_label, _option_value| specify_placeholder(option_label).present? } %>
8276
<%= tag.div class: "flex flex-wrap gap-2.5 mt-1", data: (has_specify ? { controller: "specify-option", action: "change->specify-option#update" } : {}) do %>
8377
<% radio_options.each do |option_label, option_value, option_description| %>

app/views/events/public_registrations/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
<% else %>
123123
<% submitted_value = params.dig(:public_registration, :form_fields, field.id.to_s) %>
124124
<% if submitted_value.blank? && field.field_identifier == "payment_method" %>
125-
<% submitted_value = @scholarship ? FormBuilderService::PAYMENT_METHOD_OTHER : FormBuilderService::PAYMENT_METHOD_PAY_NOW %>
125+
<% submitted_value = FormBuilderService::PAYMENT_METHOD_PAY_NOW %>
126126
<% end %>
127127
<div class="<%= field.grid_span_class %>">
128128
<%= render "events/public_registrations/form_field", field: field, value: submitted_value, label: email_label_overrides[field.field_identifier] %>

spec/requests/events/public_registrations_spec.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,17 +455,22 @@ def post_with_scholarship(scholarship_answer)
455455
field
456456
end
457457

458-
it "hides the 'Other' payment method from a normal registrant" do
458+
it "does not offer 'Other' as a payment method" do
459+
expect(FormBuilderService::PAYMENT_METHOD_OPTIONS).not_to include("Other")
460+
end
461+
462+
it "renders the remaining payment methods without 'Other'" do
459463
get new_event_public_registration_path(event)
460464

461465
expect(response.body).to include(%(value="Check"))
462466
expect(response.body).not_to include(%(value="Other"))
463467
end
464468

465-
it "keeps 'Other' as the preselected payment method for a scholarship registrant" do
469+
it "still shows the payment method (without 'Other') for a scholarship registrant" do
466470
get new_event_public_registration_path(event, scholarship_requested: "true")
467471

468-
expect(response.body).to match(/value="Other"[^>]*\bchecked\b/)
472+
expect(response.body).to include(%(value="Check"))
473+
expect(response.body).not_to include(%(value="Other"))
469474
end
470475
end
471476

0 commit comments

Comments
 (0)