Class: OnlinePayments::SDK::Domain::NetworkTokenEssentials

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#binString

Returns the current value of bin.

Returns:

  • (String)

    the current value of bin



15
16
17
# File 'lib/onlinepayments/sdk/domain/network_token_essentials.rb', line 15

def bin
  @bin
end

#country_codeString

Returns the current value of country_code.

Returns:

  • (String)

    the current value of country_code



15
16
17
# File 'lib/onlinepayments/sdk/domain/network_token_essentials.rb', line 15

def country_code
  @country_code
end

#network_tokenString

Returns the current value of network_token.

Returns:

  • (String)

    the current value of network_token



15
16
17
# File 'lib/onlinepayments/sdk/domain/network_token_essentials.rb', line 15

def network_token
  @network_token
end

#network_token_stateString

Returns the current value of network_token_state.

Returns:

  • (String)

    the current value of network_token_state



15
16
17
# File 'lib/onlinepayments/sdk/domain/network_token_essentials.rb', line 15

def network_token_state
  @network_token_state
end

#network_token_usedtrue/false

Returns the current value of network_token_used.

Returns:

  • (true/false)

    the current value of network_token_used



15
16
17
# File 'lib/onlinepayments/sdk/domain/network_token_essentials.rb', line 15

def network_token_used
  @network_token_used
end

#token_expiry_dateString

Returns the current value of token_expiry_date.

Returns:

  • (String)

    the current value of token_expiry_date



15
16
17
# File 'lib/onlinepayments/sdk/domain/network_token_essentials.rb', line 15

def token_expiry_date
  @token_expiry_date
end

Instance Method Details

#from_hash(hash) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/onlinepayments/sdk/domain/network_token_essentials.rb', line 41

def from_hash(hash)
  super
  if hash.has_key? 'bin'
    @bin = hash['bin']
  end
  if hash.has_key? 'countryCode'
    @country_code = hash['countryCode']
  end
  if hash.has_key? 'networkToken'
    @network_token = hash['networkToken']
  end
  if hash.has_key? 'networkTokenState'
    @network_token_state = hash['networkTokenState']
  end
  if hash.has_key? 'networkTokenUsed'
    @network_token_used = hash['networkTokenUsed']
  end
  if hash.has_key? 'tokenExpiryDate'
    @token_expiry_date = hash['tokenExpiryDate']
  end
end

#to_hHash

Returns:

  • (Hash)


30
31
32
33
34
35
36
37
38
39
# File 'lib/onlinepayments/sdk/domain/network_token_essentials.rb', line 30

def to_h
  hash = super
  hash['bin'] = @bin unless @bin.nil?
  hash['countryCode'] = @country_code unless @country_code.nil?
  hash['networkToken'] = @network_token unless @network_token.nil?
  hash['networkTokenState'] = @network_token_state unless @network_token_state.nil?
  hash['networkTokenUsed'] = @network_token_used unless @network_token_used.nil?
  hash['tokenExpiryDate'] = @token_expiry_date unless @token_expiry_date.nil?
  hash
end