class Datatrans::Web::Transaction

Attributes

datatrans[R]
params[R]
request[RW]
response[R]

Public Class Methods

new(datatrans, params) click to toggle source
# File lib/datatrans/web/transaction.rb, line 10
def initialize(datatrans, params)
  @datatrans = datatrans
  params = params.to_hash
  params.symbolize_keys!
  params.reverse_merge!(:reqtype => 'NOA', :useAlias => 'yes', :hiddenMode => 'yes')
  @params = params
end

Public Instance Methods

authorize() click to toggle source
# File lib/datatrans/web/transaction.rb, line 22
def authorize
  @response = AuthorizeResponse.new(datatrans, params)
  @response.successful?
end
method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/datatrans/web/transaction.rb, line 27
def method_missing(method, *args, &block)
  if response.respond_to? method.to_sym
    response.send(method)
  else
    super
  end
end
signature() click to toggle source
# File lib/datatrans/web/transaction.rb, line 18
def signature
  sign(self.datatrans.merchant_id, params[:amount], params[:currency], params[:refno])
end