Class: OnlinePayments::SDK::Domain::TokenInfo

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/token_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#expiry_dateString

Returns the current value of expiry_date.

Returns:

  • (String)

    the current value of expiry_date



13
14
15
# File 'lib/onlinepayments/sdk/domain/token_info.rb', line 13

def expiry_date
  @expiry_date
end

#is_temporarytrue/false

Returns the current value of is_temporary.

Returns:

  • (true/false)

    the current value of is_temporary



13
14
15
# File 'lib/onlinepayments/sdk/domain/token_info.rb', line 13

def is_temporary
  @is_temporary
end

#masked_panString

Returns the current value of masked_pan.

Returns:

  • (String)

    the current value of masked_pan



13
14
15
# File 'lib/onlinepayments/sdk/domain/token_info.rb', line 13

def masked_pan
  @masked_pan
end

#token_idString

Returns the current value of token_id.

Returns:

  • (String)

    the current value of token_id



13
14
15
# File 'lib/onlinepayments/sdk/domain/token_info.rb', line 13

def token_id
  @token_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/onlinepayments/sdk/domain/token_info.rb', line 33

def from_hash(hash)
  super
  if hash.has_key? 'expiryDate'
    @expiry_date = hash['expiryDate']
  end
  if hash.has_key? 'isTemporary'
    @is_temporary = hash['isTemporary']
  end
  if hash.has_key? 'maskedPan'
    @masked_pan = hash['maskedPan']
  end
  if hash.has_key? 'tokenId'
    @token_id = hash['tokenId']
  end
end

#to_hHash

Returns:

  • (Hash)


24
25
26
27
28
29
30
31
# File 'lib/onlinepayments/sdk/domain/token_info.rb', line 24

def to_h
  hash = super
  hash['expiryDate'] = @expiry_date unless @expiry_date.nil?
  hash['isTemporary'] = @is_temporary unless @is_temporary.nil?
  hash['maskedPan'] = @masked_pan unless @masked_pan.nil?
  hash['tokenId'] = @token_id unless @token_id.nil?
  hash
end