Class: OnlinePayments::SDK::Domain::MerchantAction

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/merchant_action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#action_typeString

Returns the current value of action_type.

Returns:

  • (String)

    the current value of action_type



18
19
20
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 18

def action_type
  @action_type
end

#mobile_three_d_secure_challenge_parametersOnlinePayments::SDK::Domain::MobileThreeDSecureChallengeParameters

Returns the current value of mobile_three_d_secure_challenge_parameters.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 18

def mobile_three_d_secure_challenge_parameters
  @mobile_three_d_secure_challenge_parameters
end

#redirect_dataOnlinePayments::SDK::Domain::RedirectData

Returns the current value of redirect_data.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 18

def redirect_data
  @redirect_data
end

#show_form_dataOnlinePayments::SDK::Domain::ShowFormData

Returns the current value of show_form_data.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 18

def show_form_data
  @show_form_data
end

#show_instructions_dataOnlinePayments::SDK::Domain::ShowInstructionsData

Returns the current value of show_instructions_data.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 18

def show_instructions_data
  @show_instructions_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
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 41

def from_hash(hash)
  super
  if hash.has_key? 'actionType'
    @action_type = hash['actionType']
  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 = OnlinePayments::SDK::Domain::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 = OnlinePayments::SDK::Domain::RedirectData.new_from_hash(hash['redirectData'])
  end
  if hash.has_key? 'showFormData'
    raise TypeError, "value '%s' is not a Hash" % [hash['showFormData']] unless hash['showFormData'].is_a? Hash
    @show_form_data = OnlinePayments::SDK::Domain::ShowFormData.new_from_hash(hash['showFormData'])
  end
  if hash.has_key? 'showInstructionsData'
    raise TypeError, "value '%s' is not a Hash" % [hash['showInstructionsData']] unless hash['showInstructionsData'].is_a? Hash
    @show_instructions_data = OnlinePayments::SDK::Domain::ShowInstructionsData.new_from_hash(hash['showInstructionsData'])
  end
end

#to_hHash

Returns:

  • (Hash)


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

def to_h
  hash = super
  hash['actionType'] = @action_type unless @action_type.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['showFormData'] = @show_form_data.to_h unless @show_form_data.nil?
  hash['showInstructionsData'] = @show_instructions_data.to_h unless @show_instructions_data.nil?
  hash
end