Class: Worldline::Connect::SDK::V1::Domain::TokenCardData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#card_without_cvvWorldline::Connect::SDK::V1::Domain::CardWithoutCvv

Returns the current value of card_without_cvv.

Returns:



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

def card_without_cvv
  @card_without_cvv
end

#first_transaction_dateString

Returns the current value of first_transaction_date.

Returns:

  • (String)

    the current value of first_transaction_date



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

def first_transaction_date
  @first_transaction_date
end

#provider_referenceString

Returns the current value of provider_reference.

Returns:

  • (String)

    the current value of provider_reference



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

def provider_reference
  @provider_reference
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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 = Worldline::Connect::SDK::V1::Domain::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

Returns:

  • (Hash)


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

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