Class: Bakong::Khqr::MerchantCode::MerchantId

Inherits:
TagLengthString show all
Defined in:
lib/bakong/khqr/merchant_code/global_unique_identifier.rb

Instance Attribute Summary

Attributes inherited from TagLengthString

#length, #tag, #value

Instance Method Summary collapse

Methods inherited from TagLengthString

#to_s

Constructor Details

#initialize(tag, value) ⇒ MerchantId

Returns a new instance of MerchantId.



92
93
94
95
96
97
# File 'lib/bakong/khqr/merchant_code/global_unique_identifier.rb', line 92

def initialize(tag, value)
  raise Error.from(ERROR_CODES[:MERCHANT_ID_REQUIRED]) if value.nil? || value == ""
  raise Error.from(ERROR_CODES[:MERCHANT_ID_LENGTH_INVALID]) if value.length > EMV[:INVALID_LENGTH][:MERCHANT_ID]

  super
end