diff --git a/lib/registration.rb b/lib/registration.rb index 4be0ded8053d51ee68c4a4f2f4ca97f4022bda31..0ecdfd1d79c18152162c51e5de3f939951790fe4 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 89376e432381ea187925fd0026c5bd6af32f83ab..8f9c198c56928670a2d1bcbe8e9b7431e3c52c42 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]