lib/active_merchant/billing/gateways/paymentech_orbital.rb in johnideal-activemerchant-1.4.6 vs lib/active_merchant/billing/gateways/paymentech_orbital.rb in johnideal-activemerchant-1.4.7

- old
+ new

@@ -53,53 +53,55 @@ "Content-Type" => "Application/PTI46", "Content-transfer-encoding" => "text", "Request-number" => "1", "Document-type" => "Request" } - + + attr_reader :request, :response + def initialize(options = {}) requires!(options, :login, :password, :merchant_id, :bin, :terminal_id) @options = options.merge({ :currency_code => self.class.currency_code, :currency_exponent => self.class.currency_exponent }) super end def authorize(money, credit_card=nil, options = {}) - request = NewOrderRequest.new("A", money, credit_card, options.merge(@options)) + @request = NewOrderRequest.new("A", money, credit_card, options.merge(@options)) - commit('authonly', request) + commit('authonly', @request) end def purchase(money, credit_card=nil, options = {}) - request = NewOrderRequest.new("AC", money, credit_card, options.merge(@options)) + @request = NewOrderRequest.new("AC", money, credit_card, options.merge(@options)) - commit('sale', request) + commit('sale', @request) end - + def refund(money, credit_card=nil, options={}) - request = NewOrderRequest.new("R", money, credit_card, options.merge(@options)) + @request = NewOrderRequest.new("R", money, credit_card, options.merge(@options)) - commit('refund', request) + commit('refund', @request) end def profile(action, credit_card=nil, options={}) - request = ProfileManagementRequest.new(action, credit_card, options.merge(@options)) + @request = ProfileManagementRequest.new(action, credit_card, options.merge(@options)) - commit("profile-#{action}", request) + commit("profile-#{action}", @request) end - + def void(tx_ref_num, tx_ref_idx, money=nil, options={}) - request = VoidRequest.new(tx_ref_num, tx_ref_idx, money, options.merge(@options)) + @request = VoidRequest.new(tx_ref_num, tx_ref_idx, money, options.merge(@options)) - commit('void', request) + commit('void', @request) end def end_of_day(options={}) - request = EndOfDayRequest.new(options.merge(@options)) + @request = EndOfDayRequest.new(options.merge(@options)) - commit('end of day', request) + commit('end of day', @request) end private def commit(action, request) resp = ssl_post(endpoint_url, request.to_xml, headers)