Class: PuntoPagos::Response
- Inherits:
-
Object
- Object
- PuntoPagos::Response
- Defined in:
- lib/puntopagos/response.rb
Instance Method Summary collapse
- #get_error ⇒ Object
- #get_token ⇒ Object
-
#initialize(response, env = nil) ⇒ Response
constructor
A new instance of Response.
- #payment_process_url ⇒ Object
-
#success? ⇒ Boolean
TODO validate JSON.
Constructor Details
#initialize(response, env = nil) ⇒ Response
Returns a new instance of Response.
3 4 5 6 7 8 |
# File 'lib/puntopagos/response.rb', line 3 def initialize(response, env = nil) @@config ||= PuntoPagos::Config.new(env) @@puntopagos_base_url ||= @@config.puntopagos_base_url @@response = response end |
Instance Method Details
#get_error ⇒ Object
20 21 22 |
# File 'lib/puntopagos/response.rb', line 20 def get_error @@response["error"] end |
#get_token ⇒ Object
16 17 18 |
# File 'lib/puntopagos/response.rb', line 16 def get_token @@response["token"] end |
#payment_process_url ⇒ Object
24 25 26 |
# File 'lib/puntopagos/response.rb', line 24 def payment_process_url @@puntopagos_base_url + "transaccion/procesar/"+get_token end |
#success? ⇒ Boolean
TODO validate JSON
11 12 13 14 |
# File 'lib/puntopagos/response.rb', line 11 def success? puts "#{@@response['respuesta']}" @@response["respuesta"] == "00" end |