class Datatrans::XML::Transaction::AuthorizeRequest

Public Instance Methods

process() click to toggle source
# File lib/datatrans/xml/transaction/authorize.rb, line 6
def process
  post(self.datatrans.url(:xml_authorize_url),
    :headers => { 'Content-Type' => 'text/xml' },
    :body => build_authorize_request.to_s).parsed_response
end

Private Instance Methods

build_authorize_request() click to toggle source
# File lib/datatrans/xml/transaction/authorize.rb, line 14
def build_authorize_request
  build_xml_request(:authorization) do |xml|
    xml.amount params[:amount]
    xml.currency params[:currency]
    xml.aliasCC params[:aliasCC]
    xml.expm params[:expm]
    xml.expy params[:expy]
    xml.sign sign(self.datatrans.merchant_id, params[:amount], params[:currency], params[:refno])
  end
end