Class: Qiwi::Transaction::CorrectAmountValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/qiwi/transaction.rb

Instance Method Summary collapse

Instance Method Details

#validate(txn) ⇒ Object



12
13
14
15
16
# File 'lib/qiwi/transaction.rb', line 12

def validate(txn)
  unless txn.remote_amount.to_i == txn.amount.to_i
    txn.errors.add(:amount, :invalid)
  end
end