class OpenPayU::Documents::Response

Attributes

body[RW]
parsed_data[RW]
request[RW]
response[RW]

Public Class Methods

new(data) click to toggle source
# File lib/openpayu/documents/response.rb, line 6
def initialize(data)
  @response = data[:response]
  @request = data[:request]
  @body = @response.body.is_a?(StringIO) ? @response.body.string :
    @response.body
  parse_data if verify_response
end

Public Instance Methods

method_missing(method_name) click to toggle source
# File lib/openpayu/documents/response.rb, line 14
def method_missing(method_name)
  @parsed_data[method_name.to_s]
end
order_status() click to toggle source
# File lib/openpayu/documents/response.rb, line 26
 def order_status
  @parsed_data['orders']['orders'][1]['status']
end
parse_data() click to toggle source
# File lib/openpayu/documents/response.rb, line 18
def parse_data
  @parsed_data = underscore_keys JSON.parse(@body)
end
status() click to toggle source
# File lib/openpayu/documents/response.rb, line 22
def status
  @parsed_data['status']
end