Class: OnlinePayments::SDK::Domain::Mastercard

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#authentication_optionsOnlinePayments::SDK::Domain::AuthenticationOptions?

Returns the current value of authentication_options.

Returns:



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

def authentication_options
  @authentication_options
end

#src_initiator_idString?

Returns the current value of src_initiator_id.

Returns:

  • (String, nil)

    the current value of src_initiator_id



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

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



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

def srci_dpa_id
  @srci_dpa_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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::AuthenticationOptions.new_from_hash(hash['authenticationOptions'])
  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)


22
23
24
25
26
27
28
# File 'lib/onlinepayments/sdk/domain/mastercard.rb', line 22

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