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_typeString



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

def action_type
  @action_type
end

#form_fieldsArray<Ingenico::Connect::SDK::Domain::Product::PaymentProductField>



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

def form_fields
  @form_fields
end

#mobile_three_d_secure_challenge_parametersIngenico::Connect::SDK::Domain::Payment::MobileThreeDSecureChallengeParameters



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

def mobile_three_d_secure_challenge_parameters
  @mobile_three_d_secure_challenge_parameters
end

#redirect_dataIngenico::Connect::SDK::Domain::Payment::RedirectData



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

def redirect_data
  @redirect_data
end

#rendering_dataString



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

def rendering_data
  @rendering_data
end

#show_dataArray<Ingenico::Connect::SDK::Domain::Definitions::KeyValuePair>



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

def show_data
  @show_data
end

#third_party_dataIngenico::Connect::SDK::Domain::Payment::ThirdPartyData



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

def third_party_data
  @third_party_data
end

Instance Method Details

#from_hash(hash) ⇒ Object



52
53
54
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
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 52

def from_hash(hash)
  super
  if hash.has_key? 'actionType'
    @action_type = hash['actionType']
  end
  if hash.has_key? 'formFields'
    raise TypeError, "value '%s' is not an Array" % [hash['formFields']] unless hash['formFields'].is_a? Array
    @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? 'mobileThreeDSecureChallengeParameters'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobileThreeDSecureChallengeParameters']] unless hash['mobileThreeDSecureChallengeParameters'].is_a? Hash
    @mobile_three_d_secure_challenge_parameters = Ingenico::Connect::SDK::Domain::Payment::MobileThreeDSecureChallengeParameters.new_from_hash(hash['mobileThreeDSecureChallengeParameters'])
  end
  if hash.has_key? 'redirectData'
    raise TypeError, "value '%s' is not a Hash" % [hash['redirectData']] unless hash['redirectData'].is_a? Hash
    @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'
    raise TypeError, "value '%s' is not an Array" % [hash['showData']] unless hash['showData'].is_a? Array
    @show_data = []
    hash['showData'].each do |e|
      @show_data << Ingenico::Connect::SDK::Domain::Definitions::KeyValuePair.new_from_hash(e)
    end
  end
  if hash.has_key? 'thirdPartyData'
    raise TypeError, "value '%s' is not a Hash" % [hash['thirdPartyData']] unless hash['thirdPartyData'].is_a? Hash
    @third_party_data = Ingenico::Connect::SDK::Domain::Payment::ThirdPartyData.new_from_hash(hash['thirdPartyData'])
  end
end

#to_hHash



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ingenico/connect/sdk/domain/payment/merchant_action.rb', line 40

def to_h
  hash = super
  hash['actionType'] = @action_type unless @action_type.nil?
  hash['formFields'] = @form_fields.collect{|val| val.to_h} unless @form_fields.nil?
  hash['mobileThreeDSecureChallengeParameters'] = @mobile_three_d_secure_challenge_parameters.to_h unless @mobile_three_d_secure_challenge_parameters.nil?
  hash['redirectData'] = @redirect_data.to_h unless @redirect_data.nil?
  hash['renderingData'] = @rendering_data unless @rendering_data.nil?
  hash['showData'] = @show_data.collect{|val| val.to_h} unless @show_data.nil?
  hash['thirdPartyData'] = @third_party_data.to_h unless @third_party_data.nil?
  hash
end