M lib/customer_finacials.rb => lib/customer_finacials.rb +1 -1
@@ 31,7 31,7 @@ class CustomerFinancials
end
def declines
- REDIS.get("jmp_pay_decline-#{@customer_id}")
+ REDIS.get("jmp_pay_decline-#{@customer_id}").then(&:to_i)
end
def mark_decline
M lib/financial_info.rb => lib/financial_info.rb +1 -1
@@ 17,7 17,7 @@ class AdminFinancialInfo
]).then do |transactions, declines, payment_methods, btc_addresses|
new(
transactions: transactions,
- declines: declines || 0,
+ declines: declines,
payment_methods: payment_methods, btc_addresses: btc_addresses
)
end
M lib/transaction.rb => lib/transaction.rb +1 -1
@@ 5,7 5,7 @@ require "bigdecimal"
class Transaction
def self.sale(customer, amount:, payment_method: nil)
customer.declines.then do |declines|
- raise "too many declines" if declines.to_i >= 2
+ raise "too many declines" if declines >= 2
BRAINTREE.transaction.sale(
amount: amount,