Class: Worldline::Acquiring::SDK::V1::Domain::TerminalData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#allow_single_taptrue/false



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def allow_single_tap
  @allow_single_tap
end

#card_reading_capabilitiesArray<String>



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def card_reading_capabilities
  @card_reading_capabilities
end

#cardholder_activated_terminal_levelString



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def cardholder_activated_terminal_level
  @cardholder_activated_terminal_level
end

#is_attended_terminaltrue/false



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def is_attended_terminal
  @is_attended_terminal
end

#is_offline_approvedtrue/false



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def is_offline_approved
  @is_offline_approved
end

#offline_authorization_response_codeString



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def offline_authorization_response_code
  @offline_authorization_response_code
end

#pin_entry_capabilityString



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def pin_entry_capability
  @pin_entry_capability
end

#terminal_idString



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def terminal_id
  @terminal_id
end

#terminal_locationString



20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 20

def terminal_location
  @terminal_location
end

Instance Method Details

#from_hash(hash) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 55

def from_hash(hash)
  super
  if hash.has_key? 'allowSingleTap'
    @allow_single_tap = hash['allowSingleTap']
  end
  if hash.has_key? 'cardReadingCapabilities'
    raise TypeError, "value '%s' is not an Array" % [hash['cardReadingCapabilities']] unless hash['cardReadingCapabilities'].is_a? Array
    @card_reading_capabilities = []
    hash['cardReadingCapabilities'].each do |e|
      @card_reading_capabilities << e
    end
  end
  if hash.has_key? 'cardholderActivatedTerminalLevel'
    @cardholder_activated_terminal_level = hash['cardholderActivatedTerminalLevel']
  end
  if hash.has_key? 'isAttendedTerminal'
    @is_attended_terminal = hash['isAttendedTerminal']
  end
  if hash.has_key? 'isOfflineApproved'
    @is_offline_approved = hash['isOfflineApproved']
  end
  if hash.has_key? 'offlineAuthorizationResponseCode'
    @offline_authorization_response_code = hash['offlineAuthorizationResponseCode']
  end
  if hash.has_key? 'pinEntryCapability'
    @pin_entry_capability = hash['pinEntryCapability']
  end
  if hash.has_key? 'terminalId'
    @terminal_id = hash['terminalId']
  end
  if hash.has_key? 'terminalLocation'
    @terminal_location = hash['terminalLocation']
  end
end

#to_hHash



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb', line 41

def to_h
  hash = super
  hash['allowSingleTap'] = @allow_single_tap unless @allow_single_tap.nil?
  hash['cardReadingCapabilities'] = @card_reading_capabilities unless @card_reading_capabilities.nil?
  hash['cardholderActivatedTerminalLevel'] = @cardholder_activated_terminal_level unless @cardholder_activated_terminal_level.nil?
  hash['isAttendedTerminal'] = @is_attended_terminal unless @is_attended_terminal.nil?
  hash['isOfflineApproved'] = @is_offline_approved unless @is_offline_approved.nil?
  hash['offlineAuthorizationResponseCode'] = @offline_authorization_response_code unless @offline_authorization_response_code.nil?
  hash['pinEntryCapability'] = @pin_entry_capability unless @pin_entry_capability.nil?
  hash['terminalId'] = @terminal_id unless @terminal_id.nil?
  hash['terminalLocation'] = @terminal_location unless @terminal_location.nil?
  hash
end