Class: Ingenico::Connect::SDK::Domain::Token::TokenCardData

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/token/token_card_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#card_without_cvvIngenico::Connect::SDK::Domain::Definitions::CardWithoutCvv



15
16
17
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 15

def card_without_cvv
  @card_without_cvv
end

#first_transaction_dateString



15
16
17
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 15

def first_transaction_date
  @first_transaction_date
end

#provider_referenceString



15
16
17
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 15

def provider_reference
  @provider_reference
end

Instance Method Details

#from_hash(hash) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 32

def from_hash(hash)
  super
  if hash.has_key? 'cardWithoutCvv'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardWithoutCvv']] unless hash['cardWithoutCvv'].is_a? Hash
    @card_without_cvv = Ingenico::Connect::SDK::Domain::Definitions::CardWithoutCvv.new_from_hash(hash['cardWithoutCvv'])
  end
  if hash.has_key? 'firstTransactionDate'
    @first_transaction_date = hash['firstTransactionDate']
  end
  if hash.has_key? 'providerReference'
    @provider_reference = hash['providerReference']
  end
end

#to_hHash



24
25
26
27
28
29
30
# File 'lib/ingenico/connect/sdk/domain/token/token_card_data.rb', line 24

def to_h
  hash = super
  hash['cardWithoutCvv'] = @card_without_cvv.to_h unless @card_without_cvv.nil?
  hash['firstTransactionDate'] = @first_transaction_date unless @first_transaction_date.nil?
  hash['providerReference'] = @provider_reference unless @provider_reference.nil?
  hash
end