Class: Aurfy::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/aurfy/response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Response

Returns a new instance of Response.



11
12
13
14
15
16
# File 'lib/aurfy/response.rb', line 11

def initialize(result)
  @result = result

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

Instance Attribute Details

#merchantidObject (readonly)

Returns the value of attribute merchantid.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def merchantid
  @merchantid
end

#orderamountObject (readonly)

Returns the value of attribute orderamount.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def orderamount
  @orderamount
end

#ordercurrencyObject (readonly)

Returns the value of attribute ordercurrency.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def ordercurrency
  @ordercurrency
end

#orderidObject (readonly)

Returns the value of attribute orderid.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def orderid
  @orderid
end

#ordertimeObject (readonly)

Returns the value of attribute ordertime.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def ordertime
  @ordertime
end

#respcodeObject (readonly)

Returns the value of attribute respcode.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def respcode
  @respcode
end

#respmsgObject (readonly)

Returns the value of attribute respmsg.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def respmsg
  @respmsg
end

#resultObject (readonly)

Returns the value of attribute result.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def result
  @result
end

#signatureObject (readonly)

Returns the value of attribute signature.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def signature
  @signature
end

#signmethodObject (readonly)

Returns the value of attribute signmethod.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def signmethod
  @signmethod
end

#txnidObject (readonly)

Returns the value of attribute txnid.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def txnid
  @txnid
end

#txnremark1Object (readonly)

Returns the value of attribute txnremark1.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def txnremark1
  @txnremark1
end

#txnremark2Object (readonly)

Returns the value of attribute txnremark2.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def txnremark2
  @txnremark2
end

#txnstatusObject (readonly)

Returns the value of attribute txnstatus.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def txnstatus
  @txnstatus
end

#txntimeObject (readonly)

Returns the value of attribute txntime.



3
4
5
# File 'lib/aurfy/response.rb', line 3

def txntime
  @txntime
end

Class Method Details

.keysObject



6
7
8
9
# 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

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/aurfy/response.rb', line 18

def success?
  respcode == "00"
end