Class: Worldline::Acquiring::SDK::V1::Domain::PointOfSaleDataForResponse

Inherits:
Domain::DataObject
  • Object
show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#emv_dataArray<Worldline::Acquiring::SDK::V1::Domain::EmvDataItem>

Returns the current value of emv_data.

Returns:



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_response.rb', line 15

def emv_data
  @emv_data
end

#pan_last4_digitsString

Returns the current value of pan_last4_digits.

Returns:

  • (String)

    the current value of pan_last4_digits



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_response.rb', line 15

def pan_last4_digits
  @pan_last4_digits
end

#pin_retry_counterInteger

Returns the current value of pin_retry_counter.

Returns:

  • (Integer)

    the current value of pin_retry_counter



15
16
17
# File 'lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_response.rb', line 15

def pin_retry_counter
  @pin_retry_counter
end

Instance Method Details

#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

#to_hHash

Returns:

  • (Hash)


24
25
26
27
28
29
30
# File 'lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_response.rb', line 24

def to_h
  hash = super
  hash['emvData'] = @emv_data.collect{|val| val.to_h} unless @emv_data.nil?
  hash['panLast4Digits'] = @pan_last4_digits unless @pan_last4_digits.nil?
  hash['pinRetryCounter'] = @pin_retry_counter unless @pin_retry_counter.nil?
  hash
end