class EwayRapid::DirectSettlementSearchResponse

Attributes

error[RW]
settlement_summaries[RW]
settlement_transactions[RW]

Public Class Methods

from_hash(hash) click to toggle source
# File lib/eway_rapid/entities/direct_settlement_search_response.rb, line 18
def self.from_hash(hash)
  settlement_search_response = DirectSettlementSearchResponse.new
  settlement_search_response.settlement_summaries = InternalModels::SettlementSummary.from_array(hash[Constants::SETTLEMENT_SUMMARIES])
  settlement_search_response.settlement_transactions = InternalModels::SettlementTransaction.from_array(hash[Constants::SETTLEMENT_TRANSACTIONS])
  settlement_search_response.error = hash[Constants::ERRORS_CAPITALIZED]
  settlement_search_response
end
from_json(json) click to toggle source
# File lib/eway_rapid/entities/direct_settlement_search_response.rb, line 13
def self.from_json(json)
  hash = JSON.parse(json)
  from_hash(hash)
end

Public Instance Methods

to_json(summaries={}, transactions={}) click to toggle source
# File lib/eway_rapid/entities/direct_settlement_search_response.rb, line 7
def to_json(summaries={}, transactions={})
  {Constants::SETTLEMENT_SUMMARIES => summaries,
   Constants::SETTLEMENT_TRANSACTIONS => transactions,
   Constants::ERRORS_CAPITALIZED => error}.to_json
end