Class: Worldline::Acquiring::SDK::V1::Domain::CardOnFileData

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/card_on_file_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#initial_card_on_file_dataWorldline::Acquiring::SDK::V1::Domain::InitialCardOnFileData

Returns the current value of initial_card_on_file_data.

Returns:



16
17
18
# File 'lib/worldline/acquiring/sdk/v1/domain/card_on_file_data.rb', line 16

def initial_card_on_file_data
  @initial_card_on_file_data
end

#is_initial_transactiontrue/false

Returns the current value of is_initial_transaction.

Returns:

  • (true/false)

    the current value of is_initial_transaction



16
17
18
# File 'lib/worldline/acquiring/sdk/v1/domain/card_on_file_data.rb', line 16

def is_initial_transaction
  @is_initial_transaction
end

#subsequent_card_on_file_dataWorldline::Acquiring::SDK::V1::Domain::SubsequentCardOnFileData

Returns the current value of subsequent_card_on_file_data.

Returns:



16
17
18
# File 'lib/worldline/acquiring/sdk/v1/domain/card_on_file_data.rb', line 16

def subsequent_card_on_file_data
  @subsequent_card_on_file_data
end

Instance Method Details

#from_hash(hash) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/worldline/acquiring/sdk/v1/domain/card_on_file_data.rb', line 33

def from_hash(hash)
  super
  if hash.has_key? 'initialCardOnFileData'
    raise TypeError, "value '%s' is not a Hash" % [hash['initialCardOnFileData']] unless hash['initialCardOnFileData'].is_a? Hash
    @initial_card_on_file_data = Worldline::Acquiring::SDK::V1::Domain::InitialCardOnFileData.new_from_hash(hash['initialCardOnFileData'])
  end
  if hash.has_key? 'isInitialTransaction'
    @is_initial_transaction = hash['isInitialTransaction']
  end
  if hash.has_key? 'subsequentCardOnFileData'
    raise TypeError, "value '%s' is not a Hash" % [hash['subsequentCardOnFileData']] unless hash['subsequentCardOnFileData'].is_a? Hash
    @subsequent_card_on_file_data = Worldline::Acquiring::SDK::V1::Domain::SubsequentCardOnFileData.new_from_hash(hash['subsequentCardOnFileData'])
  end
end

#to_hHash

Returns:

  • (Hash)


25
26
27
28
29
30
31
# File 'lib/worldline/acquiring/sdk/v1/domain/card_on_file_data.rb', line 25

def to_h
  hash = super
  hash['initialCardOnFileData'] = @initial_card_on_file_data.to_h unless @initial_card_on_file_data.nil?
  hash['isInitialTransaction'] = @is_initial_transaction unless @is_initial_transaction.nil?
  hash['subsequentCardOnFileData'] = @subsequent_card_on_file_data.to_h unless @subsequent_card_on_file_data.nil?
  hash
end