Method: Worldline::Acquiring::SDK::V1::Domain::PointOfSaleDataForResponse#from_hash

Defined in:
lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_response.rb

#from_hash(hash) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_response.rb', line 32

def from_hash(hash)
  super
  if hash.has_key? 'emvData'
    raise TypeError, "value '%s' is not an Array" % [hash['emvData']] unless hash['emvData'].is_a? Array
    @emv_data = []
    hash['emvData'].each do |e|
      @emv_data << Worldline::Acquiring::SDK::V1::Domain::EmvDataItem.new_from_hash(e)
    end
  end
  if hash.has_key? 'panLast4Digits'
    @pan_last4_digits = hash['panLast4Digits']
  end
  if hash.has_key? 'pinRetryCounter'
    @pin_retry_counter = hash['pinRetryCounter']
  end
end