Class: Bakong::Khqr::MerchantCode::TransactionAmount
- Inherits:
-
TagLengthString
- Object
- TagLengthString
- Bakong::Khqr::MerchantCode::TransactionAmount
- Defined in:
- lib/bakong/khqr/merchant_code/transaction_amount.rb
Instance Attribute Summary
Attributes inherited from TagLengthString
Instance Method Summary collapse
-
#initialize(tag, value) ⇒ TransactionAmount
constructor
A new instance of TransactionAmount.
Methods inherited from TagLengthString
Constructor Details
#initialize(tag, value) ⇒ TransactionAmount
Returns a new instance of TransactionAmount.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bakong/khqr/merchant_code/transaction_amount.rb', line 12 def initialize(tag, value) string_value = value.to_s if string_value.length > EMV[:INVALID_LENGTH][:AMOUNT] || string_value.include?("-") || value.nil? || string_value == "" raise Error.from(ERROR_CODES[:TRANSACTION_AMOUNT_INVALID]) end super end |