class Refund
Public Class Methods
new(app, key, endpoint)
click to toggle source
# File lib/redpay/refund.rb, line 8 def initialize(app, key, endpoint) @app = app @key = key @endpoint = endpoint end
Public Instance Methods
Process(request)
click to toggle source
# File lib/redpay/refund.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 refund packet req = { "transactionId" => json_request.transactionId, "action" => "R", } return session.Send(req) end