Class: Ingenico::Direct::SDK::Domain::CardPaymentMethodSpecificOutput

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#authenticated_amountLong

Returns the current value of authenticated_amount.

Returns:

  • (Long)

    the current value of authenticated_amount



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def authenticated_amount
  @authenticated_amount
end

#authorisation_codeString

Returns the current value of authorisation_code.

Returns:

  • (String)

    the current value of authorisation_code



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def authorisation_code
  @authorisation_code
end

#cardIngenico::Direct::SDK::Domain::CardEssentials

Returns the current value of card.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def card
  @card
end

#external_token_linkedIngenico::Direct::SDK::Domain::ExternalTokenLinked

Returns the current value of external_token_linked.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def external_token_linked
  @external_token_linked
end

#fraud_resultsIngenico::Direct::SDK::Domain::CardFraudResults

Returns the current value of fraud_results.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def fraud_results
  @fraud_results
end

#initial_scheme_transaction_idString

Returns the current value of initial_scheme_transaction_id.

Returns:

  • (String)

    the current value of initial_scheme_transaction_id



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def initial_scheme_transaction_id
  @initial_scheme_transaction_id
end

#payment_optionString

Returns the current value of payment_option.

Returns:

  • (String)

    the current value of payment_option



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def payment_option
  @payment_option
end

#payment_product_idInteger

Returns the current value of payment_product_id.

Returns:

  • (Integer)

    the current value of payment_product_id



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def payment_product_id
  @payment_product_id
end

#three_d_secure_resultsIngenico::Direct::SDK::Domain::ThreeDSecureResults

Returns the current value of three_d_secure_results.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def three_d_secure_results
  @three_d_secure_results
end

#tokenString

Returns the current value of token.

Returns:

  • (String)

    the current value of token



24
25
26
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 24

def token
  @token
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
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 52

def from_hash(hash)
  super
  @authenticated_amount = hash['authenticatedAmount'] if hash.key? 'authenticatedAmount'
  @authorisation_code = hash['authorisationCode'] if hash.key? 'authorisationCode'
  if hash.key? 'card'
    raise TypeError, "value '%s' is not a Hash" % [hash['card']] unless hash['card'].is_a? Hash
    @card = Ingenico::Direct::SDK::Domain::CardEssentials.new_from_hash(hash['card'])
  end
  if hash.key? 'externalTokenLinked'
    raise TypeError, "value '%s' is not a Hash" % [hash['externalTokenLinked']] unless hash['externalTokenLinked'].is_a? Hash
    @external_token_linked = Ingenico::Direct::SDK::Domain::ExternalTokenLinked.new_from_hash(hash['externalTokenLinked'])
  end
  if hash.key? 'fraudResults'
    raise TypeError, "value '%s' is not a Hash" % [hash['fraudResults']] unless hash['fraudResults'].is_a? Hash
    @fraud_results = Ingenico::Direct::SDK::Domain::CardFraudResults.new_from_hash(hash['fraudResults'])
  end
  @initial_scheme_transaction_id = hash['initialSchemeTransactionId'] if hash.key? 'initialSchemeTransactionId'
  @payment_option = hash['paymentOption'] if hash.key? 'paymentOption'
  @payment_product_id = hash['paymentProductId'] if hash.key? 'paymentProductId'
  if hash.key? 'threeDSecureResults'
    raise TypeError, "value '%s' is not a Hash" % [hash['threeDSecureResults']] unless hash['threeDSecureResults'].is_a? Hash
    @three_d_secure_results = Ingenico::Direct::SDK::Domain::ThreeDSecureResults.new_from_hash(hash['threeDSecureResults'])
  end
  @token = hash['token'] if hash.key? 'token'
end

#to_hHash

Returns:

  • (Hash)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb', line 37

def to_h
  hash = super
  hash['authenticatedAmount'] = @authenticated_amount unless @authenticated_amount.nil?
  hash['authorisationCode'] = @authorisation_code unless @authorisation_code.nil?
  hash['card'] = @card.to_h if @card
  hash['externalTokenLinked'] = @external_token_linked.to_h if @external_token_linked
  hash['fraudResults'] = @fraud_results.to_h if @fraud_results
  hash['initialSchemeTransactionId'] = @initial_scheme_transaction_id unless @initial_scheme_transaction_id.nil?
  hash['paymentOption'] = @payment_option unless @payment_option.nil?
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
  hash['threeDSecureResults'] = @three_d_secure_results.to_h if @three_d_secure_results
  hash['token'] = @token unless @token.nil?
  hash
end