class Aurfy::Response

Attributes

merchantid[R]
orderamount[R]
ordercurrency[R]
orderid[R]
ordertime[R]
respcode[R]
respmsg[R]
response[R]
signature[R]
signmethod[R]
txnid[R]
txnremark1[R]
txnremark2[R]
txnstatus[R]
txntime[R]

Public Class Methods

keys() click to toggle source
# File lib/aurfy/response.rb, line 6
def self.keys
  [:merchantid, :orderamount, :ordercurrency, :orderid, :ordertime, :respcode, :respmsg, :signature, :signmethod,
   :txnid, :txnremark1, :txnremark2, :txnstatus, :txntime]
end
new(response) click to toggle source
# File lib/aurfy/response.rb, line 11
def initialize(response)
  @response = response

  parsed_params = Parser.new(response.body).parse
  assign_variables(parsed_params)
end

Public Instance Methods

success?() click to toggle source
# File lib/aurfy/response.rb, line 18
def success?
  respcode === "00"
end

Private Instance Methods

assign_variables(params) click to toggle source
# File lib/aurfy/response.rb, line 24
def assign_variables(params)
  params.each_pair do |key, value|
    next unless Response.keys.include? key
    instance_variable_set(:"@#{key}", value)
  end
end