Sha256: db25b65de05a879f6539249585a7b5b6377f52e1a5e51aa10a3b94cc8eb78704

Contents?: true

Size: 1.32 KB

Versions: 284

Compression:

Stored size: 1.32 KB

Contents

class Caboose::PaymentProcessors::Authorizenet < Caboose::PaymentProcessors::Base
  
  def self.api(root, body, test=false)
  end
  
  def self.form_url(order=nil)
    if Rails.env == 'development'
      'https://test.authorize.net/gateway/transact.dll'
    else
      'https://secure.authorize.net/gateway/transact.dll'
    end
  end
  
  def self.authorize(order, params)
    order.update_attribute(:transaction_id, params[:x_trans_id]) if params[:x_trans_id]
    return params[:x_response_code] == '1'
  end
  
  def self.void(order)
    sc = order.site.store_config
    response = AuthorizeNet::SIM::Transaction.new(
      sc.pp_username, sc.pp_password, order.total,
      :transaction_type => 'VOID',
      :transaction_id => order.transaction_id
    )    
    #ap response
  end
  
  def self.capture(order)
    sc = order.site.store_config
    response = AuthorizeNet::SIM::Transaction.new(
      sc.pp_username, sc.pp_password, order.total,
      :transaction_type => 'CAPTURE_ONLY',
      :transaction_id => order.transaction_id
    )    
    #ap response
  end
  
  def self.refund(order)
    sc = order.site.store_config
    response = AuthorizeNet::SIM::Transaction.new(
      sc.pp_username, sc.pp_password, order.total,
      :transaction_type => 'CREDIT',
      :transaction_id => order.transaction_id
    )    
    #ap response
  end
end

Version data entries

284 entries across 284 versions & 1 rubygems

Version Path
caboose-cms-0.7.74 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.73 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.72 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.71 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.70 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.69 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.68 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.67 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.66 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.65 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.64 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.63 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.62 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.61 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.60 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.59 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.58 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.57 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.55 app/models/caboose/payment_processors/authorizenet.rb
caboose-cms-0.7.54 app/models/caboose/payment_processors/authorizenet.rb