Class: Ingenico::Connect::SDK::Domain::Payment::CardPaymentMethodSpecificInput

Inherits:
AbstractCardPaymentMethodSpecificInput show all
Defined in:
lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractCardPaymentMethodSpecificInput

#authorization_mode, #customer_reference, #recurring, #recurring_payment_sequence_indicator, #requires_approval, #skip_authentication, #skip_fraud_service, #token, #tokenize, #transaction_channel, #unscheduled_card_on_file_indicator, #unscheduled_card_on_file_requestor, #unscheduled_card_on_file_sequence_indicator

Attributes inherited from Definitions::AbstractPaymentMethodSpecificInput

#payment_product_id

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#cardObject



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

def card
  @card
end

#external_cardholder_authentication_dataObject

ExternalCardholderAuthenticationData

Deprecated; Use threeDSecure.externalCardholderAuthenticationData instead



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

def external_cardholder_authentication_data
  @external_cardholder_authentication_data
end

#is_recurringObject

true/false



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

def is_recurring
  @is_recurring
end

#return_urlObject

String

Deprecated; Use threeDSecure.redirectionData.returnUrl instead



30
31
32
# File 'lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input.rb', line 30

def return_url
  @return_url
end

#three_d_secureObject



33
34
35
# File 'lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input.rb', line 33

def three_d_secure
  @three_d_secure
end

Instance Method Details

#from_hash(hash) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input.rb', line 45

def from_hash(hash)
  super
  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::Card.new_from_hash(hash['card'])
  end
  if hash.has_key?('externalCardholderAuthenticationData')
    if !(hash['externalCardholderAuthenticationData'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['externalCardholderAuthenticationData']]
    end
    @external_cardholder_authentication_data = Ingenico::Connect::SDK::Domain::Payment::ExternalCardholderAuthenticationData.new_from_hash(hash['externalCardholderAuthenticationData'])
  end
  if hash.has_key?('isRecurring')
    @is_recurring = hash['isRecurring']
  end
  if hash.has_key?('returnUrl')
    @return_url = hash['returnUrl']
  end
  if hash.has_key?('threeDSecure')
    if !(hash['threeDSecure'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['threeDSecure']]
    end
    @three_d_secure = Ingenico::Connect::SDK::Domain::Payment::ThreeDSecure.new_from_hash(hash['threeDSecure'])
  end
end

#to_hObject



35
36
37
38
39
40
41
42
43
# File 'lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input.rb', line 35

def to_h
  hash = super
  add_to_hash(hash, 'card', @card)
  add_to_hash(hash, 'externalCardholderAuthenticationData', @external_cardholder_authentication_data)
  add_to_hash(hash, 'isRecurring', @is_recurring)
  add_to_hash(hash, 'returnUrl', @return_url)
  add_to_hash(hash, 'threeDSecure', @three_d_secure)
  hash
end