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



16
17
18
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 16

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:



16
17
18
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 16

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:



16
17
18
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 16

def redirect_data
  @redirect_data
end

#show_form_dataOnlinePayments::SDK::Domain::ShowFormData

Returns the current value of show_form_data.

Returns:



16
17
18
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 16

def show_form_data
  @show_form_data
end

Instance Method Details

#from_hash(hash) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 36

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
end

#to_hHash

Returns:

  • (Hash)


27
28
29
30
31
32
33
34
# File 'lib/onlinepayments/sdk/domain/merchant_action.rb', line 27

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
end