class Ingenico::Direct::SDK::Domain::PayoutErrorResponse

@attr [String] error_id @attr [Array<Ingenico::Direct::SDK::Domain::APIError>] errors @attr [Ingenico::Direct::SDK::Domain::PayoutResult] payout_result

Attributes

error_id[RW]
errors[RW]
payout_result[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/payout_error_response.rb, line 29
def from_hash(hash)
  super
  @error_id = hash['errorId'] if hash.key? 'errorId'
  if hash.key? 'errors'
    raise TypeError, "value '%s' is not an Array" % [hash['errors']] unless hash['errors'].is_a? Array
    @errors = []
    hash['errors'].each do |e|
      @errors << Ingenico::Direct::SDK::Domain::APIError.new_from_hash(e)
    end
  end
  if hash.key? 'payoutResult'
    raise TypeError, "value '%s' is not a Hash" % [hash['payoutResult']] unless hash['payoutResult'].is_a? Hash
    @payout_result = Ingenico::Direct::SDK::Domain::PayoutResult.new_from_hash(hash['payoutResult'])
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/payout_error_response.rb, line 21
def to_h
  hash = super
  hash['errorId'] = @error_id unless @error_id.nil?
  hash['errors'] = @errors.collect(&:to_h) if @errors
  hash['payoutResult'] = @payout_result.to_h if @payout_result
  hash
end