Class: OnlinePayments::SDK::Domain::Visa

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#authentication_optionsOnlinePayments::SDK::Domain::VisaAuthenticationOptions?

Returns the current value of authentication_options.

Returns:



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

def authentication_options
  @authentication_options
end

#encryption_keyString?

Returns the current value of encryption_key.

Returns:

  • (String, nil)

    the current value of encryption_key



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

def encryption_key
  @encryption_key
end

#n_modulusString?

Returns the current value of n_modulus.

Returns:

  • (String, nil)

    the current value of n_modulus



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

def n_modulus
  @n_modulus
end

#src_initiator_idString?

Returns the current value of src_initiator_id.

Returns:

  • (String, nil)

    the current value of src_initiator_id



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

def src_initiator_id
  @src_initiator_id
end

#srci_dpa_idString?

Returns the current value of srci_dpa_id.

Returns:

  • (String, nil)

    the current value of srci_dpa_id



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

def srci_dpa_id
  @srci_dpa_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/onlinepayments/sdk/domain/visa.rb', line 38

def from_hash(hash)
  super
  if hash.has_key? 'authenticationOptions'
    raise TypeError, "value '%s' is not a Hash" % [hash['authenticationOptions']] unless hash['authenticationOptions'].is_a? Hash
    @authentication_options = OnlinePayments::SDK::Domain::VisaAuthenticationOptions.new_from_hash(hash['authenticationOptions'])
  end
  if hash.has_key? 'encryptionKey'
    @encryption_key = hash['encryptionKey']
  end
  if hash.has_key? 'nModulus'
    @n_modulus = hash['nModulus']
  end
  if hash.has_key? 'srcInitiatorId'
    @src_initiator_id = hash['srcInitiatorId']
  end
  if hash.has_key? 'srciDpaId'
    @srci_dpa_id = hash['srciDpaId']
  end
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
35
36
# File 'lib/onlinepayments/sdk/domain/visa.rb', line 28

def to_h
  hash = super
  hash['authenticationOptions'] = @authentication_options.to_h unless @authentication_options.nil?
  hash['encryptionKey'] = @encryption_key unless @encryption_key.nil?
  hash['nModulus'] = @n_modulus unless @n_modulus.nil?
  hash['srcInitiatorId'] = @src_initiator_id unless @src_initiator_id.nil?
  hash['srciDpaId'] = @srci_dpa_id unless @srci_dpa_id.nil?
  hash
end