Class: Ingenico::Connect::SDK::Domain::Payment::MerchantAction

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/payment/merchant_action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#action_typeObject

String



17
18
19
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 17

def action_type
  @action_type
end

#form_fieldsObject



20
21
22
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 20

def form_fields
  @form_fields
end

#redirect_dataObject



23
24
25
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 23

def redirect_data
  @redirect_data
end

#rendering_dataObject

String



26
27
28
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 26

def rendering_data
  @rendering_data
end

#show_dataObject



29
30
31
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 29

def show_data
  @show_data
end

Instance Method Details

#from_hash(hash) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 41

def from_hash(hash)
  super
  if hash.has_key?('actionType')
    @action_type = hash['actionType']
  end
  if hash.has_key?('formFields')
    if !(hash['formFields'].is_a? Array)
      raise TypeError, "value '%s' is not an Array" % [hash['formFields']]
    end
    @form_fields = []
    hash['formFields'].each do |e|
      @form_fields << Ingenico::Connect::SDK::Domain::Product::PaymentProductField.new_from_hash(e)
    end
  end
  if hash.has_key?('redirectData')
    if !(hash['redirectData'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['redirectData']]
    end
    @redirect_data = Ingenico::Connect::SDK::Domain::Payment::RedirectData.new_from_hash(hash['redirectData'])
  end
  if hash.has_key?('renderingData')
    @rendering_data = hash['renderingData']
  end
  if hash.has_key?('showData')
    if !(hash['showData'].is_a? Array)
      raise TypeError, "value '%s' is not an Array" % [hash['showData']]
    end
    @show_data = []
    hash['showData'].each do |e|
      @show_data << Ingenico::Connect::SDK::Domain::Definitions::KeyValuePair.new_from_hash(e)
    end
  end
end

#to_hObject



31
32
33
34
35
36
37
38
39
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 31

def to_h
  hash = super
  add_to_hash(hash, 'actionType', @action_type)
  add_to_hash(hash, 'formFields', @form_fields)
  add_to_hash(hash, 'redirectData', @redirect_data)
  add_to_hash(hash, 'renderingData', @rendering_data)
  add_to_hash(hash, 'showData', @show_data)
  hash
end