Class: PuntoPagos::Status
- Inherits:
-
Object
- Object
- PuntoPagos::Status
- Defined in:
- lib/puntopagos/status.rb
Instance Method Summary collapse
- #check(token, trx_id, amount) ⇒ Object
- #error ⇒ Object
-
#initialize(env = nil) ⇒ Status
constructor
A new instance of Status.
- #valid? ⇒ Boolean
Constructor Details
#initialize(env = nil) ⇒ Status
Returns a new instance of Status.
3 4 5 6 7 8 9 |
# File 'lib/puntopagos/status.rb', line 3 def initialize env = nil @env = env @@config ||= PuntoPagos::Config.new(env) @@function = "transaccion/traer" @@endpoint = "transaccion" @@response = nil end |
Instance Method Details
#check(token, trx_id, amount) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/puntopagos/status.rb', line 12 def check token, trx_id, amount = = (token, trx_id, amount, ) = PuntoPagos::Authorization.new(@env) signature = .sign() executioner = PuntoPagos::Executioner.new(@env) @@response = executioner.call_api(token, @@endpoint, :get, signature, ) end |
#error ⇒ Object
25 26 27 |
# File 'lib/puntopagos/status.rb', line 25 def error @@response['error'] end |
#valid? ⇒ Boolean
21 22 23 |
# File 'lib/puntopagos/status.rb', line 21 def valid? @@response['respuesta'] == '00' end |