Class: Worldline::Acquiring::SDK::V1::Domain::ApiIncrementResponse

Inherits:
ApiActionResponse show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/api_increment_response.rb

Instance Attribute Summary collapse

Attributes inherited from ApiActionResponse

#operation_id, #payment, #responder, #response_code, #response_code_category, #response_code_description

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#authorization_codeString

Returns the current value of authorization_code.

Returns:

  • (String)

    the current value of authorization_code



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

def authorization_code
  @authorization_code
end

#total_authorized_amountWorldline::Acquiring::SDK::V1::Domain::AmountData

Returns the current value of total_authorized_amount.

Returns:



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

def total_authorized_amount
  @total_authorized_amount
end

Instance Method Details

#from_hash(hash) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/worldline/acquiring/sdk/v1/domain/api_increment_response.rb', line 28

def from_hash(hash)
  super
  if hash.has_key? 'authorizationCode'
    @authorization_code = hash['authorizationCode']
  end
  if hash.has_key? 'totalAuthorizedAmount'
    raise TypeError, "value '%s' is not a Hash" % [hash['totalAuthorizedAmount']] unless hash['totalAuthorizedAmount'].is_a? Hash
    @total_authorized_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['totalAuthorizedAmount'])
  end
end

#to_hHash

Returns:

  • (Hash)


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

def to_h
  hash = super
  hash['authorizationCode'] = @authorization_code unless @authorization_code.nil?
  hash['totalAuthorizedAmount'] = @total_authorized_amount.to_h unless @total_authorized_amount.nil?
  hash
end