From 8cb2f01e7869dcf7ac075d3436d42904e0526c1c Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 16 Jun 2021 20:44:39 -0500 Subject: [PATCH] Save legacy session for Bitcoin flow 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. --- lib/registration.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/registration.rb b/lib/registration.rb index 99588d1bb11120e0ba5d67b7687ca80985bc1045..dea1dc7f48c8bdb9d2b0972f7ae94965292873bc 100644 --- a/lib/registration.rb +++ b/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