Class: Worldline::Connect::SDK::V1::Domain::CreateMandateResponse

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/create_mandate_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#mandateWorldline::Connect::SDK::V1::Domain::MandateResponse

Returns the current value of mandate.

Returns:



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/create_mandate_response.rb', line 16

def mandate
  @mandate
end

#merchant_actionWorldline::Connect::SDK::V1::Domain::MandateMerchantAction

Returns the current value of merchant_action.

Returns:



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/create_mandate_response.rb', line 16

def merchant_action
  @merchant_action
end

Instance Method Details

#from_hash(hash) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/worldline/connect/sdk/v1/domain/create_mandate_response.rb', line 30

def from_hash(hash)
  super
  if hash.has_key? 'mandate'
    raise TypeError, "value '%s' is not a Hash" % [hash['mandate']] unless hash['mandate'].is_a? Hash
    @mandate = Worldline::Connect::SDK::V1::Domain::MandateResponse.new_from_hash(hash['mandate'])
  end
  if hash.has_key? 'merchantAction'
    raise TypeError, "value '%s' is not a Hash" % [hash['merchantAction']] unless hash['merchantAction'].is_a? Hash
    @merchant_action = Worldline::Connect::SDK::V1::Domain::MandateMerchantAction.new_from_hash(hash['merchantAction'])
  end
end

#to_hHash

Returns:

  • (Hash)


23
24
25
26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/create_mandate_response.rb', line 23

def to_h
  hash = super
  hash['mandate'] = @mandate.to_h unless @mandate.nil?
  hash['merchantAction'] = @merchant_action.to_h unless @merchant_action.nil?
  hash
end