Class: OnlinePayments::SDK::Domain::ThreeDSecureBase

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#authentication_amountInteger



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def authentication_amount
  @authentication_amount
end

#challenge_canvas_sizeString



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def challenge_canvas_size
  @challenge_canvas_size
end

#challenge_indicatorString



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def challenge_indicator
  @challenge_indicator
end

#exemption_requestString



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def exemption_request
  @exemption_request
end

#merchant_fraud_rateInteger



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def merchant_fraud_rate
  @merchant_fraud_rate
end

#prior_three_d_secure_dataOnlinePayments::SDK::Domain::ThreeDSecureData



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def prior_three_d_secure_data
  @prior_three_d_secure_data
end

#secure_corporate_paymenttrue/false



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def secure_corporate_payment
  @secure_corporate_payment
end

#skip_authenticationtrue/false



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def skip_authentication
  @skip_authentication
end

#skip_soft_declinetrue/false



19
20
21
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 19

def skip_soft_decline
  @skip_soft_decline
end

Instance Method Details

#from_hash(hash) ⇒ Object



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
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 54

def from_hash(hash)
  super
  if hash.has_key? 'authenticationAmount'
    @authentication_amount = hash['authenticationAmount']
  end
  if hash.has_key? 'challengeCanvasSize'
    @challenge_canvas_size = hash['challengeCanvasSize']
  end
  if hash.has_key? 'challengeIndicator'
    @challenge_indicator = hash['challengeIndicator']
  end
  if hash.has_key? 'exemptionRequest'
    @exemption_request = hash['exemptionRequest']
  end
  if hash.has_key? 'merchantFraudRate'
    @merchant_fraud_rate = hash['merchantFraudRate']
  end
  if hash.has_key? 'priorThreeDSecureData'
    raise TypeError, "value '%s' is not a Hash" % [hash['priorThreeDSecureData']] unless hash['priorThreeDSecureData'].is_a? Hash
    @prior_three_d_secure_data = OnlinePayments::SDK::Domain::ThreeDSecureData.new_from_hash(hash['priorThreeDSecureData'])
  end
  if hash.has_key? 'secureCorporatePayment'
    @secure_corporate_payment = hash['secureCorporatePayment']
  end
  if hash.has_key? 'skipAuthentication'
    @skip_authentication = hash['skipAuthentication']
  end
  if hash.has_key? 'skipSoftDecline'
    @skip_soft_decline = hash['skipSoftDecline']
  end
end

#to_hHash



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/onlinepayments/sdk/domain/three_d_secure_base.rb', line 40

def to_h
  hash = super
  hash['authenticationAmount'] = @authentication_amount unless @authentication_amount.nil?
  hash['challengeCanvasSize'] = @challenge_canvas_size unless @challenge_canvas_size.nil?
  hash['challengeIndicator'] = @challenge_indicator unless @challenge_indicator.nil?
  hash['exemptionRequest'] = @exemption_request unless @exemption_request.nil?
  hash['merchantFraudRate'] = @merchant_fraud_rate unless @merchant_fraud_rate.nil?
  hash['priorThreeDSecureData'] = @prior_three_d_secure_data.to_h unless @prior_three_d_secure_data.nil?
  hash['secureCorporatePayment'] = @secure_corporate_payment unless @secure_corporate_payment.nil?
  hash['skipAuthentication'] = @skip_authentication unless @skip_authentication.nil?
  hash['skipSoftDecline'] = @skip_soft_decline unless @skip_soft_decline.nil?
  hash
end