lib/atol/request/post_document/item/body.rb in atol-0.7 vs lib/atol/request/post_document/item/body.rb in atol-0.7.1
- old
+ new
@@ -22,11 +22,11 @@
]
attr_accessor :config, :name, :price, :quantity, :payment_method, :payment_object
def initialize(config: nil, name:, price:, quantity: 1, payment_method:, payment_object:)
- raise Atol::ZeroItemQuantityError if quantity.to_i.zero?
+ raise Atol::ZeroItemQuantityError if quantity.to_f.zero?
raise BadPaymentMethodError unless PAYMENT_METHODS.include?(payment_method.to_s)
raise BadPaymentObjectError unless PAYMENT_OBJECTS.include?(payment_object.to_s)
self.config = config || Atol.config
self.name = name
@@ -38,10 +38,10 @@
def to_h
body.clone
end
- def to_json
+ def to_json(*_args)
body.to_json
end
private