Save legacy session for Bitcoin flow

Stephen Paul Weber created

This is not a permanent solution, but for now it will allow Bitcoin flow users
to get the same message from the cronjob that legacy web flow users get, and
thus complete their signup using the legacy web flow.

Eventually we'll want to reverse this and direct every Bitcoin activation via a
new end flow.

Change summary

lib/registration.rb | 10 ++++++++++
1 file changed, 10 insertions(+)

Detailed changes

lib/registration.rb 🔗

@@ -2,6 +2,7 @@
 
 require "erb"
 require "ruby-bandwidth-iris"
+require "securerandom"
 
 require_relative "./bandwidth_tn_order"
 require_relative "./em"
@@ -174,8 +175,17 @@ class Registration
 
 			attr_reader :reply, :customer_id, :tel
 
+			def legacy_session_save
+				sid = SecureRandom.hex
+				REDIS.mset(
+					"reg-sid_for-#{customer_id}", sid,
+					"reg-session_tel-#{sid}", tel
+				)
+			end
+
 			def save
 				EMPromise.all([
+					legacy_session_save,
 					REDIS.mset(
 						"pending_tel_for-#{customer_id}", tel,
 						"pending_plan_for-#{customer_id}", @customer.plan_name