Sha256: b5543b9e6c3d55b610a0cf62845a234d0dee89b3945064c23efff595275ca4ac
Contents?: true
Size: 1.4 KB
Versions: 11
Compression:
Stored size: 1.4 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.authnet_api_login_id, sc.authnet_api_transaction_key, 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.authnet_api_login_id, sc.authnet_api_transaction_key, 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.authnet_api_login_id, sc.authnet_api_transaction_key, order.total, :transaction_type => 'CREDIT', :transaction_id => order.transaction_id ) #ap response end end
Version data entries
11 entries across 11 versions & 1 rubygems