Change summary
lib/registration.rb | 7 +++++++
lib/sim_order.rb | 1 +
2 files changed, 8 insertions(+)
Detailed changes
@@ -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
@@ -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|