class Datatrans::XML::Transaction
Attributes
datatrans[R]
params[R]
request[RW]
response[R]
Public Class Methods
new(datatrans, params)
click to toggle source
# File lib/datatrans/xml/transaction.rb, line 8 def initialize(datatrans, params) @datatrans = datatrans @params = params.symbolize_keys end
Public Instance Methods
capture()
click to toggle source
# File lib/datatrans/xml/transaction.rb, line 25 def capture self.request = CaptureRequest.new(self.datatrans, params) @response = CaptureResponse.new(self.datatrans, request.process) @response.successful? end
method_missing(method, *args, &block)
click to toggle source
TODO: purchase, credit methods
Calls superclass method
# File lib/datatrans/xml/transaction.rb, line 40 def method_missing(method, *args, &block) if response.respond_to? method.to_sym response.send(method) elsif request.respond_to? method.to_sym request.send(method) else super end end
status()
click to toggle source
# File lib/datatrans/xml/transaction.rb, line 31 def status self.request = StatusRequest.new(self.datatrans, params) @response = StatusResponse.new(self.datatrans, request.process) @response.successful? end
void()
click to toggle source
# File lib/datatrans/xml/transaction.rb, line 19 def void self.request = VoidRequest.new(self.datatrans, params) @response = VoidResponse.new(self.datatrans, request.process) @response.successful? end