From 6100ac7b60d16e40a50aa2d17d888d4e2afd1780 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 26 May 2021 14:39:58 -0500 Subject: [PATCH] Update instructions to be closer to what is in current web signup --- lib/registration.rb | 28 ++++++++++++++++++++++++++-- test/test_registration.rb | 2 +- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/lib/registration.rb b/lib/registration.rb index 4be0ded..0ecdfd1 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -67,7 +67,7 @@ class Registration }, { value: "credit_card", - label: "Credit Card ($#{CONFIG[:activation_amount]})" + label: "Credit Card" }, { value: "code", @@ -93,12 +93,36 @@ class Registration } ].freeze + ACTIVATE_INSTRUCTION = + "To activate your account, you can either deposit " \ + "$#{CONFIG[:activation_amount]} to your balance or enter " \ + "your invite code if you have one." + + CRYPTOCURRENCY_INSTRUCTION = + "(If you'd like to pay in a cryptocurrency other than " \ + "Bitcoin, currently we recommend using a service like " \ + "simpleswap.io, morphtoken.com, changenow.io, or godex.io. " \ + "Manual payment via Bitcoin Cash is also available if you " \ + "contact support.)" + + def add_instructions(form, center) + [ + "You've selected #{tel} (#{center}) as your JMP number", + ACTIVATE_INSTRUCTION, + CRYPTOCURRENCY_INSTRUCTION + ].each do |txt| + form << Blather::XMPPNode.new(:instructions, form.document).tap do |i| + i << txt + end + end + end + def write rate_center.then do |center| form = reply.form form.type = :form form.title = "Activate JMP" - form.instructions = "Going to activate #{tel} (#{center})" + add_instructions(form, center) form.fields = FORM_FIELDS COMMAND_MANAGER.write(reply).then { |iq| diff --git a/test/test_registration.rb b/test/test_registration.rb index 89376e4..8f9c198 100644 --- a/test/test_registration.rb +++ b/test/test_registration.rb @@ -90,7 +90,7 @@ class RegistrationTest < Minitest::Test [Matching.new do |iq| assert_equal :form, iq.form.type assert_equal( - "Going to activate +15555550000 (FA, KE)", + "You've selected +15555550000 (FA, KE) as your JMP number", iq.form.instructions ) end] -- 2.38.4