class Qiwi::Request::GetBillList

Public Class Methods

new(client, hash) click to toggle source

@param [Hash] params @option params [String] :user e.g. a phone number @option params [Time] :date_from @option params [Time] :date_to @option params [Fixnum] :status

Calls superclass method Qiwi::Request::Base::new
# File lib/qiwi/request.rb, line 129
def initialize(client, hash)
  super
  @dateFrom = hash[:date_from].strftime('%d.%m.%Y %H:%M:%S') if hash[:date_from]
  @dateTo = hash[:date_to].strftime('%d.%m.%Y %H:%M:%S') if hash[:date_to]
end

Public Instance Methods

result_from_xml(xml) click to toggle source
# File lib/qiwi/request.rb, line 135
def result_from_xml(xml)
  el = xml.xpath("//getBillListResponse")
  OpenStruct.new({
    txns: el.at('txns').text,
    count: el.at('count').text.to_i
  })
end