Class: Ingenico::Connect::SDK::Domain::Payment::CardPaymentMethodSpecificOutput

Inherits:
AbstractPaymentMethodSpecificOutput show all
Defined in:
lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_output.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractPaymentMethodSpecificOutput

#payment_product_id

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#authorisation_codeObject

String



17
18
19
# File 'lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_output.rb', line 17

def authorisation_code
  @authorisation_code
end

#cardObject



20
21
22
# File 'lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_output.rb', line 20

def card
  @card
end

#fraud_resultsObject



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

def fraud_results
  @fraud_results
end

#three_d_secure_resultsObject



26
27
28
# File 'lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_output.rb', line 26

def three_d_secure_results
  @three_d_secure_results
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/card_payment_method_specific_output.rb', line 37

def from_hash(hash)
  super
  if hash.has_key?('authorisationCode')
    @authorisation_code = hash['authorisationCode']
  end
  if hash.has_key?('card')
    if !(hash['card'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['card']]
    end
    @card = Ingenico::Connect::SDK::Domain::Definitions::CardEssentials.new_from_hash(hash['card'])
  end
  if hash.has_key?('fraudResults')
    if !(hash['fraudResults'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['fraudResults']]
    end
    @fraud_results = Ingenico::Connect::SDK::Domain::Definitions::CardFraudResults.new_from_hash(hash['fraudResults'])
  end
  if hash.has_key?('threeDSecureResults')
    if !(hash['threeDSecureResults'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['threeDSecureResults']]
    end
    @three_d_secure_results = Ingenico::Connect::SDK::Domain::Payment::ThreeDSecureResults.new_from_hash(hash['threeDSecureResults'])
  end
end

#to_hObject



28
29
30
31
32
33
34
35
# File 'lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_output.rb', line 28

def to_h
  hash = super
  add_to_hash(hash, 'authorisationCode', @authorisation_code)
  add_to_hash(hash, 'card', @card)
  add_to_hash(hash, 'fraudResults', @fraud_results)
  add_to_hash(hash, 'threeDSecureResults', @three_d_secure_results)
  hash
end