Class: Worldline::Acquiring::SDK::V1::Domain::DukptPinEncryptionData

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

Constant Summary collapse

PIN_ENCRYPTION_TYPE =
'DUKPT'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Constructor Details

#initialize ⇒ DukptPinEncryptionData

Returns a new instance of DukptPinEncryptionData.



20
21
22
23
# File 'lib/worldline/acquiring/sdk/v1/domain/dukpt_pin_encryption_data.rb', line 20

def initialize
  super
  @pin_encryption_type = PIN_ENCRYPTION_TYPE
end

Instance Attribute Details

#key_serial_number ⇒ String

Returns the current value of key_serial_number.

Returns:

  • (String) —

    the current value of key_serial_number



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

def key_serial_number
  @key_serial_number
end

Instance Method Details

#from_hash(hash) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/worldline/acquiring/sdk/v1/domain/dukpt_pin_encryption_data.rb', line 38

def from_hash(hash)
  super
  @pin_encryption_type = PIN_ENCRYPTION_TYPE
  if hash.has_key? 'keySerialNumber'
    @key_serial_number = hash['keySerialNumber']
  end
end

#pin_encryption_type ⇒ String

Returns:

  • (String)


26
27
28
# File 'lib/worldline/acquiring/sdk/v1/domain/dukpt_pin_encryption_data.rb', line 26

def pin_encryption_type
  PIN_ENCRYPTION_TYPE
end

#to_h ⇒ Hash

Returns:

  • (Hash)


31
32
33
34
35
36
# File 'lib/worldline/acquiring/sdk/v1/domain/dukpt_pin_encryption_data.rb', line 31

def to_h
  hash = super
  hash['keySerialNumber'] = @key_serial_number unless @key_serial_number.nil?
  hash['pinEncryptionType'] = PIN_ENCRYPTION_TYPE
  hash
end