Every payment kind will need the plan, so put it at the top

Stephen Paul Weber created

Change summary

lib/registration.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Detailed changes

lib/registration.rb 🔗

@@ -110,6 +110,8 @@ class Registration
 		end
 
 		def self.for(iq, customer, tel)
+			plan_name = iq.form.field("plan_name").value.to_s
+			customer = customer.with_plan(plan_name)
 			kinds.fetch(iq.form.field("activation_method")&.value&.to_s&.to_sym) {
 				raise "Invalid activation method"
 			}.call(iq, customer, tel)
@@ -123,8 +125,7 @@ class Registration
 				reply.note_type = :info
 				reply.status = :completed
 
-				plan_name = iq.form.field("plan_name").value.to_s
-				@customer = customer.with_plan(plan_name)
+				@customer = customer
 				@customer_id = customer.customer_id
 				@tel = tel
 				@addr = ELECTRUM.createnewaddress