diff --git a/lib/registration.rb b/lib/registration.rb index 0b22c9bfb88ce55d86eed70c263bc3dd242e8874..06f028be74cff686766982d2a515c6822451e6e2 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -82,6 +82,13 @@ class Registration class DataOnly def self.for(customer, sim_kind) cfg = sim_kind.cfg(customer.currency) + log.debug( + "DataOnly#for", + cfg: cfg, + customer_balance: customer.balance, + customer_currency: customer.currency, + cfg_price: cfg[:price] + ) unless cfg && customer.balance >= cfg[:price] return PayForSim.new(customer, sim_kind) end diff --git a/lib/sim_order.rb b/lib/sim_order.rb index dc7b04082a695251d6a6e1bd318b782504097c94..e10f2af74d230e40558aaab922efcc973b1cc72e 100644 --- a/lib/sim_order.rb +++ b/lib/sim_order.rb @@ -38,6 +38,7 @@ class SIMOrder def self.for(customer, price:, **kwargs) price = price.to_i / 100.to_d + log.debug("SIMOrder.for", balance: customer.balance, price: price) return new(customer, price: price, **kwargs) if customer.balance >= price LowBalance::AutoTopUp.for(customer, price).then do |top_up|