~singpolyma/sgx-jmp

5ad2c9e4ad04c3a1b8215b28a4b2bf61a84ac928 — Stephen Paul Weber 1 year, 1 month ago 8b80a1f
Use billing customer for LowBalance notification
1 files changed, 2 insertions(+), 2 deletions(-)

M lib/low_balance.rb
M lib/low_balance.rb => lib/low_balance.rb +2 -2
@@ 8,10 8,10 @@ class LowBalance
		return Locked.new unless customer.registered?

		ExpiringLock.new(
			"jmp_customer_low_balance-#{customer.customer_id}",
			"jmp_customer_low_balance-#{customer.billing_customer_id}",
			expiry: 60 * 60 * 24 * 7
		).with(-> { Locked.new }) do
			for_no_lock(customer)
			customer.billing_customer.then(&method(:for_no_lock))
		end
	end