Class: Void
- Inherits:
-
Object
- Object
- Void
- Defined in:
- lib/redpay/void.rb
Instance Method Summary collapse
-
#initialize(app, key, endpoint) ⇒ Void
constructor
A new instance of Void.
- #Process(request) ⇒ Object
Constructor Details
#initialize(app, key, endpoint) ⇒ Void
Returns a new instance of Void.
8 9 10 11 12 |
# File 'lib/redpay/void.rb', line 8 def initialize(app, key, endpoint) @app = app @key = key @endpoint = endpoint end |
Instance Method Details
#Process(request) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/redpay/void.rb', line 14 def Process(request) json_request = JSON.parse(request.to_json, object_class: OpenStruct) # TODO Validate request here # Create a session with the server session = Session.new(@app, @key, @endpoint + "ecard") # Contruct void packet req = { "transactionId" => json_request.transactionId, "action" => "V", } return session.Send(req) end |