Class: Worldline::Acquiring::SDK::V1::Domain::AesUkptPinEncryptionData

Inherits:
PinEncryptionData show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/aes_ukpt_pin_encryption_data.rb

Constant Summary collapse

PIN_ENCRYPTION_TYPE =
'AES_UKPT'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Constructor Details

#initialize ⇒ AesUkptPinEncryptionData

Returns a new instance of AesUkptPinEncryptionData.



23
24
25
26
# File 'lib/worldline/acquiring/sdk/v1/domain/aes_ukpt_pin_encryption_data.rb', line 23

def initialize
  super
  @pin_encryption_type = PIN_ENCRYPTION_TYPE
end

Instance Attribute Details

#key_generation ⇒ Integer

Returns the current value of key_generation.

Returns:

  • (Integer) —

    the current value of key_generation



13
14
15
# File 'lib/worldline/acquiring/sdk/v1/domain/aes_ukpt_pin_encryption_data.rb', line 13

def key_generation
  @key_generation
end

#random_value ⇒ String

Returns the current value of random_value.

Returns:

  • (String) —

    the current value of random_value



13
14
15
# File 'lib/worldline/acquiring/sdk/v1/domain/aes_ukpt_pin_encryption_data.rb', line 13

def random_value
  @random_value
end

Instance Method Details

#from_hash(hash) ⇒ Object



42
43
44
45
46
47
48
49
50
51
# File 'lib/worldline/acquiring/sdk/v1/domain/aes_ukpt_pin_encryption_data.rb', line 42

def from_hash(hash)
  super
  @pin_encryption_type = PIN_ENCRYPTION_TYPE
  if hash.has_key? 'keyGeneration'
    @key_generation = hash['keyGeneration']
  end
  if hash.has_key? 'randomValue'
    @random_value = hash['randomValue']
  end
end

#pin_encryption_type ⇒ String

Returns:

  • (String)


29
30
31
# File 'lib/worldline/acquiring/sdk/v1/domain/aes_ukpt_pin_encryption_data.rb', line 29

def pin_encryption_type
  PIN_ENCRYPTION_TYPE
end

#to_h ⇒ Hash

Returns:

  • (Hash)


34
35
36
37
38
39
40
# File 'lib/worldline/acquiring/sdk/v1/domain/aes_ukpt_pin_encryption_data.rb', line 34

def to_h
  hash = super
  hash['keyGeneration'] = @key_generation unless @key_generation.nil?
  hash['randomValue'] = @random_value unless @random_value.nil?
  hash['pinEncryptionType'] = PIN_ENCRYPTION_TYPE
  hash
end