From cf0db8da4138daebc2a8e04b9902974b080bb310 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 18 Jun 2025 10:27:17 -0500 Subject: [PATCH] Remove mostly-unused final_message Was only being used for PayPal transitions (which are mostly done) and only when transitioning to BTC (which they usually don't) and only provided extra reinforcement of a message they've already seen by now. Let's not complicate the code for that. --- forms/registration/bch.rb | 5 +---- forms/registration/btc.rb | 5 +---- forms/registration/mail.rb | 3 +-- lib/registration.rb | 14 +++++--------- sgx_jmp.rb | 1 - 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/forms/registration/bch.rb b/forms/registration/bch.rb index 3af32deddbcfffc86ac5ca354ab3d2242f356bd5..e01390d7f07adce0869d8814d9055f23b917c76e 100644 --- a/forms/registration/bch.rb +++ b/forms/registration/bch.rb @@ -13,7 +13,4 @@ field( value: @addr ) -instructions( - "You will received a notification when your payment is complete." \ - "#{@final_message}" -) +instructions "You will received a notification when your payment is complete." diff --git a/forms/registration/btc.rb b/forms/registration/btc.rb index 9451e7681766b01b0f09266c326ecaa6d3fb1706..9228e0eb655805cd81629b47618322d45c9cb00c 100644 --- a/forms/registration/btc.rb +++ b/forms/registration/btc.rb @@ -13,7 +13,4 @@ field( value: @addr ) -instructions( - "You will received a notification when your payment is complete." \ - "#{@final_message}" -) +instructions "You will received a notification when your payment is complete." diff --git a/forms/registration/mail.rb b/forms/registration/mail.rb index f801b0fd76f8622f11759dfbcab596ab1655d695..8020de25516553ab59bfa60f02ae8585a43db7e9 100644 --- a/forms/registration/mail.rb +++ b/forms/registration/mail.rb @@ -5,8 +5,7 @@ instructions( "Activate your account by sending at least " \ "$#{CONFIG[:activation_amount]}\nWe support payment by " \ "postal mail or, in Canada, by Interac e-Transfer.\n\n" \ - "You will receive a notification when your payment is complete." \ - "#{@final_message}" + "You will receive a notification when your payment is complete." ) if @customer_id diff --git a/lib/registration.rb b/lib/registration.rb index 1884cf59dd4e088bc02d5ad35bfdefb87c270893..7c2e23c0dcac3da4f5bc29c5524948ca86a4d2c9 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -279,10 +279,10 @@ class Registration @kinds ||= {} end - def self.for(iq, customer, tel, final_message: nil, finish: Finish) + def self.for(iq, customer, tel, finish: Finish) kinds.fetch(iq.form.field("activation_method")&.value&.to_s&.to_sym) { raise "Invalid activation method" - }.call(customer, tel, final_message: final_message, finish: finish) + }.call(customer, tel, finish: finish) end class CryptoPaymentMethod @@ -298,11 +298,10 @@ class Registration raise NotImplementedError, "Subclass must implement" end - def initialize(customer, tel, final_message: nil, **) + def initialize(customer, tel, **) @customer = customer @customer_id = customer.customer_id @tel = tel - @final_message = final_message end def save @@ -317,8 +316,7 @@ class Registration FormTemplate.render( reg_form_name, amount: amount, - addr: addr, - final_message: @final_message + addr: addr ) end @@ -537,17 +535,15 @@ class Registration class Mail Payment.kinds[:mail] = method(:new) - def initialize(customer, tel, final_message: nil, **) + def initialize(customer, tel, **) @customer = customer @tel = tel - @final_message = final_message end def form FormTemplate.render( "registration/mail", currency: @customer.currency, - final_message: @final_message, **onboarding_extras ) end diff --git a/sgx_jmp.rb b/sgx_jmp.rb index ca1827c340cc25e6ce4ee09a72cb9a53ca185b91..de932d7c6c8470b49dda58a7078f4433c17644a0 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -621,7 +621,6 @@ Command.new( customer.save_plan!.then { Registration::Payment.for( iq, customer, customer.registered?.phone, - final_message: PaypalDone::MESSAGE, finish: PaypalDone ) }.then(&:write).catch_only(Command::Execution::FinalStanza) do |s|