lib/stripe_fee/calculator.rb in stripe_fee-0.1.0 vs lib/stripe_fee/calculator.rb in stripe_fee-0.1.1
- old
+ new
@@ -9,10 +9,10 @@
@amount = amount
@currency = currency
end
def validate!
- raise ::AmountError unless @amount.to_f
+ raise ::AmountError unless @amount.to_f && @amount.to_f > 0
raise ::CurrencyError unless @currency == 'usd'
end
def amount_in_cents
@amount.to_f * 100
\ No newline at end of file