@@ 4,6 4,7 @@ require "erb"
require "ruby-bandwidth-iris"
require "securerandom"
+require_relative "./alt_top_up_form"
require_relative "./bandwidth_tn_order"
require_relative "./em"
require_relative "./oob"
@@ 67,16 68,20 @@ class Registration
required: true,
options: [
{
- value: "bitcoin",
- label: "Bitcoin"
- },
- {
value: "credit_card",
label: "Credit Card"
},
{
+ value: "bitcoin",
+ label: "Bitcoin"
+ },
+ {
value: "code",
label: "Invite Code"
+ },
+ {
+ value: "mail",
+ label: "Mail or eTransfer"
}
]
},
@@ 400,6 405,39 @@ class Registration
end
end
end
+
+ class Mail
+ Payment.kinds[:mail] = method(:new)
+
+ def initialize(iq, _customer, _tel)
+ @reply = iq.reply
+ @reply.status = :completed
+ end
+
+ def form
+ form = Blather::Stanza::X.new(:result)
+ form.title = "Activate by Mail or eTransfer"
+ form.instructions =
+ "We support payment by postal mail or, in Canada by Interac, " \
+ "eTransfer. Minimum deposit for a new account is " \
+ "$#{CONFIG[:activation_amount]}"
+
+ form.fields = fields.to_a
+ form
+ end
+
+ def fields
+ [
+ AltTopUpForm::MAILING_ADDRESS,
+ AltTopUpForm::IS_CAD
+ ].flatten
+ end
+
+ def write
+ @reply.command << form
+ BLATHER << @reply
+ end
+ end
end
class Finish