Class: Qiwi::Request::CheckBill

Inherits:
Base
  • Object
show all
Defined in:
lib/qiwi/request.rb

Instance Method Summary collapse

Methods inherited from Base

attributes, #body, inherited, #initialize, #method, #soap_body, #with_envelope

Constructor Details

This class inherits a constructor from Qiwi::Request::Base

Instance Method Details

#result_from_xml(xml) ⇒ Object

Examples:

{:user=>"name", :amount=>1000.0, :date=>"07.09.2012 13:33", :status=>60}


106
107
108
109
110
111
112
113
114
115
# File 'lib/qiwi/request.rb', line 106

def result_from_xml(xml)
  el = xml.xpath("//checkBillResponse")
  OpenStruct.new({
    user: el.at('user').text,
    amount: el.at('amount').text.to_f,
    date: el.at('date').text,
    lifetime: el.at('lifetime').text,
    status: el.at('status').text.to_i
  })
end