config-schema.dhall 🔗
@@ -1,4 +1,5 @@
{ activation_amount : Natural
+, activation_amount_accept : Natural
, admins : List Text
, adr : Text
, approved_domains : List { mapKey : Text, mapValue : Optional Text }
Stephen Paul Weber created
config-schema.dhall | 1 +
config.dhall.sample | 1 +
lib/registration.rb | 2 ++
test/test_helper.rb | 1 +
4 files changed, 5 insertions(+)
@@ -1,4 +1,5 @@
{ activation_amount : Natural
+, activation_amount_accept : Natural
, admins : List Text
, adr : Text
, approved_domains : List { mapKey : Text, mapValue : Optional Text }
@@ -66,6 +66,7 @@ in
},
oxr_app_id = "",
activation_amount = 15,
+ activation_amount_accept = 15,
credit_card_url = \(jid: Text) -> \(customer_id: Text) ->
"https://pay.jmp.chat/${jid}/credit_cards?customer_id=${customer_id}",
electrum_notify_url = \(address: Text) -> \(customer_id: Text) ->
@@ -38,6 +38,8 @@ class Registration
jid = ProxiedJID.new(customer.jid).unproxied
if customer.active?
Finish.new(customer, tel)
+ elsif customer.balance >= CONFIG[:activation_amount_accept]
+ BillPlan.new(customer, tel)
elsif CONFIG[:approved_domains].key?(jid.domain.to_sym)
Allow.for(customer, tel, jid)
else
@@ -68,6 +68,7 @@ CONFIG = {
},
notify_from: "notify_from@example.org",
activation_amount: 1,
+ activation_amount_accept: 1,
plans: [
{
name: "test_usd",