Class: Ingenico::Connect::SDK::Domain::Payment::MerchantAction
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Payment::MerchantAction
- Defined in:
- lib/ingenico/connect/sdk/domain/payment/merchant_action.rb
Overview
Class MerchantAction
Instance Attribute Summary collapse
-
#action_type ⇒ Object
String.
- #redirect_data ⇒ Object
-
#rendering_data ⇒ Object
String.
-
#show_data ⇒ Object
Array of Definitions::KeyValuePair.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#action_type ⇒ Object
String
17 18 19 |
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 17 def action_type @action_type end |
#redirect_data ⇒ Object
20 21 22 |
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 20 def redirect_data @redirect_data end |
#rendering_data ⇒ Object
String
23 24 25 |
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 23 def rendering_data @rendering_data end |
#show_data ⇒ Object
Array of Definitions::KeyValuePair
26 27 28 |
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 26 def show_data @show_data end |
Instance Method Details
#from_hash(hash) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 37 def from_hash(hash) super if hash.has_key?('actionType') @action_type = hash['actionType'] 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_h ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 28 def to_h hash = super add_to_hash(hash, 'actionType', @action_type) add_to_hash(hash, 'redirectData', @redirect_data) add_to_hash(hash, 'renderingData', @rendering_data) add_to_hash(hash, 'showData', @show_data) hash end |